After upgrading typescript and express-session, the tsc is loading custom type defination stubs.
I am getting this error even though i have merged type declaration here
Also i have added ./typing-stubs in tsconfig.json
"typeRoots": [
"./typing-stubs",
"./node_modules/@types"
],
The problem is, type merging for express is loading but not for express-session
Hopefully of some help. I've just sorted it here with:
declare module "express-session" {
interface Session {
user: string;
}
}
The interface decalred for req.session seems to have changed from SessionData to Session from @types/express-session 1.17.0 → 1.17.1.
This issue is probably more at home over at https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-session where the @types/* modules live.
Thanks a lot @bencevans you saved my day
req.sessionseems to have changed fromSessionDatatoSession
@bencevans Then why did clicking on session in req.session I was redirected to SessionData typing stub?
Most helpful comment
Hopefully of some help. I've just sorted it here with:
The interface decalred for
req.sessionseems to have changed fromSessionDatatoSessionfrom@types/express-session1.17.0 → 1.17.1.This issue is probably more at home over at https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-session where the
@types/*modules live.