Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode not loading merged declaration #792

Closed
tbhaxor opened this issue Nov 11, 2020 · 3 comments
Closed

VSCode not loading merged declaration #792

tbhaxor opened this issue Nov 11, 2020 · 3 comments

Comments

@tbhaxor
Copy link

tbhaxor commented Nov 11, 2020

After upgrading typescript and express-session, the tsc is loading custom type defination stubs.

enter image description here

I am getting this error even though i have merged type declaration here

enter image description 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

enter image description here

@tbhaxor tbhaxor changed the title Typescript not loading merged declaration VSCode not loading merged declaration Nov 12, 2020
@bencevans
Copy link

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.

@tbhaxor
Copy link
Author

tbhaxor commented Nov 12, 2020

Thanks a lot @bencevans you saved my day

@tbhaxor tbhaxor closed this as completed Nov 12, 2020
@tbhaxor
Copy link
Author

tbhaxor commented Nov 12, 2020

req.session seems to have changed from SessionData to Session

@bencevans Then why did clicking on session in req.session I was redirected to SessionData typing stub?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants