You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And I noticed that there are some typing issues (I'm not alone, see this issue in express).
Solution / TL;DR
As stated in this answer the problem is that express-session is wrongly pulling @types/express@5 instead of ^4.17.5, when running yarn why @types/express I get:
yarn why @types/express 07:39:00
yarn why v1.22.22
[1/4] Why do we have the module "@types/express"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "@types/[email protected]"
info Has been hoisted to "@types/express"
info This module exists because it's specified in "devDependencies".
info Disk size without dependencies: "20KB"
info Disk size with unique dependencies: "128KB"
info Disk size with transitive dependencies: "2.76MB"
info Number of shared dependencies: 7
=> Found "@types/express-session#@types/[email protected]"
info This module exists because "@types#express-session" depends on it.
info Disk size without dependencies: "20KB"
info Disk size with unique dependencies: "128KB"
info Disk size with transitive dependencies: "2.76MB"
info Number of shared dependencies: 7
Done in 0.28s.
The solution was to (again, thanks to this answer) to force "resolutions" (or "overrides" for nmp) in package.json as follows:
// index.tsimportsessionfrom"express-session";importexpressfrom"express";constapp=express();app.use(session({/* session details */})// <--- error on this line);
I get the following error No overload matches this call. Argument of type 'RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>' is not assignable to parameter of type 'PathParams'.ts(2769)
Thanks for your time.
The text was updated successfully, but these errors were encountered:
Issue
I recently done an upgrade of my packages, namely:
[email protected]
to[email protected]
[email protected]
to[email protected]
And I noticed that there are some typing issues (I'm not alone, see this issue in express).
Solution / TL;DR
As stated in this answer the problem is that express-session is wrongly pulling
@types/express@5
instead of^4.17.5
, when runningyarn why @types/express
I get:The solution was to (again, thanks to this answer) to force "resolutions" (or "overrides" for nmp) in package.json as follows:
How to reproduce
Create a project with the following dependencies (package.json):
And this code
I get the following error
No overload matches this call. Argument of type 'RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>' is not assignable to parameter of type 'PathParams'.ts(2769)
Thanks for your time.
The text was updated successfully, but these errors were encountered: