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

Update @types/express-jwt version #87

Closed
wants to merge 1 commit into from
Closed

Update @types/express-jwt version #87

wants to merge 1 commit into from

Conversation

Abazhenov
Copy link

@Abazhenov Abazhenov commented Mar 25, 2019

@types/express-jwt 0.0.34 declares the following global type for express's req.user object

declare global {
    namespace Express {
        export interface Request {
            user?: any
        }
    }
}

Due to this - when trying to type out the req.user project in your own project the following error is thrown:

node_modules/@types/express-jwt/index.d.ts:43:13 - error TS2717: Subsequent property declarations must have the same type. Property 'user' must be of type '{ id: string }', but here has type 'any'

This PR updates @types/express-jwt to its latest version - which no longer declares a global express type.

`@types/express-jwt 0.0.34` declares the following global type for express's `req.user` object

```
declare global {
    namespace Express {
        export interface Request {
            user?: any
        }
    }
}
```

Due to this - when trying to type out the req.user project in your own project the following error is thrown:

`node_modules/@types/express-jwt/index.d.ts:43:13 - error TS2717: Subsequent property declarations must have the same type.  Property 'user' must be of type '{ id: string }', but here has type 'any'`

This PR updates `@types/express-jwt` to its latest version - which no longer declares a global express type.
@damieng
Copy link
Contributor

damieng commented May 21, 2019

Thanks! This actually also needed to be made a devDependency so it's been done in #91

@damieng damieng closed this May 21, 2019
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

Successfully merging this pull request may close these issues.

None yet

2 participants