Passport: Typeerror

Created on 2 Dec 2019  路  2Comments  路  Source: jaredhanson/passport

Good night!
I was starting at authentication on nestjs on the official site https://docs.nestjs.com/techniques/authentication and after i build it, the following type error appear:

node_modules/@types/passport/index.d.ts(77,64): error TS2344: Type 'Request>' does not satisfy the constraint 'IncomingMessage'.
Type 'Request>' is missing the following properties from type 'IncomingMessage': httpVersion, httpVersionMajor, httpVersionMinor, connection, and 38 more.
node_modules/@types/passport/index.d.ts(79,66): error TS2344: Type 'Request>' does not satisfy the constraint 'IncomingMessage'.
node_modules/@types/passport/node_modules/@types/express/index.d.ts(90,90): error TS2315: Type 'ErrorRequestHandler' is not generic.
node_modules/@types/passport/node_modules/@types/express/index.d.ts(99,78): error TS2315: Type 'Request' is not generic.
node_modules/@types/passport/node_modules/@types/express/index.d.ts(100,85): error TS2315: Type 'RequestHandler' is not generic

passport: 0.4.0
@types/passport: 1.0.2

Most helpful comment

Removing all the passport types the official site tells to install seems to work:

yarn remove @types/passport-local @types/passport-jwt

Those files are not in the example code package.json.

All 2 comments

Removing the passport types (@types/passport: 1.0.2) fixed it for me.

Removing all the passport types the official site tells to install seems to work:

yarn remove @types/passport-local @types/passport-jwt

Those files are not in the example code package.json.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

itaditya picture itaditya  路  5Comments

PymZoR picture PymZoR  路  3Comments

xingrz picture xingrz  路  5Comments

franckl picture franckl  路  5Comments

Gibbo3771 picture Gibbo3771  路  4Comments