Reputation: 1943
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
Upvotes: 1
Views: 524
Reputation: 1943
I just got the answer from the express team on the issue
The interface declared for req.session
is changed from SessionData
to Session
from @types/express-session 1.17.0 → 1.17.1. You can see here https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-session
So the fix is
declare module "express-session" {
interface Session {
user: string;
}
}
Upvotes: 2