I'm trying to build a typeScript project but it has an error and I do not know where it comes from and nothing has changed since last time.
node_modules/connect-mongo/src/types.d.ts:113:66 - error TS2694: Namespace 'Express' has no exported member 'SessionData'.
113 get: (sid: string, callback: (err: any, session: Express.SessionData | null) => void) => void;
~~~~~~~~~~~
node_modules/connect-mongo/src/types.d.ts:114:45 - error TS2694: Namespace 'Express' has no exported member 'SessionData'.
114 set: (sid: string, session: Express.SessionData, callback?: (err: any) => void) => void;
~~~~~~~~~~~
node_modules/connect-mongo/src/types.d.ts:118:47 - error TS2694: Namespace 'Express' has no exported member 'SessionData'.
118 touch: (sid: string, session: Express.SessionData, callback?: (err: any) => void) => void;
~~~~~~~~~~~
src/controllers/http/auth/auth.ts:16:44 - error TS2339: Property 'user' does not exist on type 'Session & Partial<SessionData>'.
16 if (req.session && req.session.user) {
~~~~
src/controllers/http/auth/auth.ts:41:29 - error TS2339: Property 'user' does not exist on type 'Session & Partial<SessionData>'.
41 req.session.user = user;
~~~~
The place where the typescript gives an error
express-session this is how it is imported
I reverted back to this version to fix the issue: "@types/express-session": "1.15.16",
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With