Iam geting 2 errors that are below , created the src/types/express.d.ts and
`declare global {
namespace Express {
interface Request {
user?: any;
}
}
}
export {}; // This line makes this file a module`
if i remove the import in the src/index.ts Property ‘user’ does not exist on type ‘Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>’.
enter image description here
if i import it import "./types/express";
the error
Tsconfig.json
{ "compilerOptions": { "target": "ES6", "module": "commonjs", "outDir": "./dist", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, "skipLibCheck": true, "typeRoots": ["./node_modules/@types", "./src/types"] }, "include": ["src/**/*.ts", "src/types/**/*.d.ts"] }
i tried to to add the user to the request in the express.js