Typescript Declaration Merging fail about Express Request
问题 When i extend express request, i got this erorr. error TS2339: Property 'test' does not exist on type 'Request<ParamsDictionary, any, any, ParsedQs>'. This is my test code that extend request. app.get('/auth/google/callback', passport.authenticate('google', { failureRedirect: '/login' }), function(req: Request, res: Response) { req.test = 'aa' return console.log(req.test) }); For solving it, i already searched a lot and i did it. Make types/express/index.d.ts file. i add typeRoots in tsconfig