I'm trying to add express-session to my Node.js application which is running under the Docker.
Read a lot of posts:
Express Session: Property 'signin' does not exist on type 'Session & Partial<SessionData>'. (2339) https://github.com/DefinitelyTyped/DefinitelyTyped/issues/49941 https://github.com/DefinitelyTyped/DefinitelyTyped/issues/46861
I've tried to do a declaration merging of Session property, here is how my tsconfig.json looks like:
"typeRoots": [
  "./src/types",
  "./node_modules/@types"
]
In my src/types folder I have index.d.ts file:
declare module 'express-session' {
 interface Session {
    user: string;
  }
}
But when I run my project with docker-compose up command it gives me the following error:
/app/node_modules/ts-node/src/index.ts:421
     return new TSError(diagnosticText, diagnosticCodes)
            ^
 TSError: ⨯ Unable to compile TypeScript:
 src/routes/auth.ts(26,17): error TS2339: Property 'user' does not exist on type 'Session & Partial<SessionData>'.
 
     at createTSError (/app/node_modules/ts-node/src/index.ts:421:12
I don't think it is a Docker issue cause it happens during Node.js app boot. Does anyone has any idea how this could be resolved?