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
[@types/express] Namespace 'serveStatic' has no exported member 'RequestHandlerConstructor' #49595
Comments
It's a problem with the type dependencies for the express types. See #47339. These commands fixed it for me:
|
Thank you,but i remove the @types/express dependence in my dependencies. |
Also having this issue. +1 |
Removing the @types/express dependency fixed the issue in a API project based on Express (without NestJS). Upgrading server-static typing dependencies did not work in my case. |
+1 when I installed twilio API with NestJS |
This helped me as a temp solution: |
Same for me |
@Benjamin-Gardien were you able to solve problem with Twilio api? |
@DmytroA it's my teammate @QuanticPotatoes who solved this issue 👌🏼 |
I'm in a firebase project so for me the issue was with Since 4.17.9 is backwards compatible (fortunately 😄) I've set the resolution for all express types to 4.17.9. And that solved it for me. 🎉 // package.json
{
"dependencies": {
"@types/express": "4.17.9"
// ...
},
"resolutions": {
"@types/express": "4.17.9"
}
} |
This reverts commit 377d11b.
Its works for me... Thanks!!! |
I use yarn, then I removed those dependencies from yarn.lock and installed again and It worked for me, thanks! |
This works for me now too, thanks. |
Works for me as well. I'm using NestJS |
Literally removing |
...with a little extra help from @abernix because these types seem like they're acting up again. This time, I've found another issue on DefinitelyTyped that seems like it's prescribing a solution that was occurring in this particular attempt at updating the types, resulting in the error message of: Namespace 'serveStatic' has no exported member 'RequestHandlerConstructor' The (attempted, but seemingly working) fix was: npm update @types/express-serve-static-core --depth 2 npm update @types/serve-static --depth 2 Ref: DefinitelyTyped/DefinitelyTyped#49595 But also, in reverse chronological order at attempted resolution: Ref: 6e86f67 Ref: #4493 Ref: c67e8ec Cc: @glasser
...with a little extra help from @abernix because these types seem like they're acting up again. This time, I've found another issue on DefinitelyTyped that seems like it's prescribing a solution that was occurring in this particular attempt at updating the types, resulting in the error message of: Namespace 'serveStatic' has no exported member 'RequestHandlerConstructor' The (attempted, but seemingly working) fix was: npm update @types/express-serve-static-core --depth 2 npm update @types/serve-static --depth 2 Ref: DefinitelyTyped/DefinitelyTyped#49595 But also, in reverse chronological order at attempted resolution: Ref: 6e86f67 Ref: #4493 Ref: c67e8ec Cc: @glasser Co-authored-by: Jesse Rosenberger <git@jro.cc>
"@types/express": "4.17.11",
"@types/express-serve-static-core": "4.17.19",
"@types/serve-static": "1.13.9", Add these to package.json, this helped me as a temp solution. |
If you are having conflicts due to multiple libraries pulling in
|
- As per the suggestion in #70, applied version 2.24.0 - Added version of static types until DefinitelyTyped/DefinitelyTyped#49595 is fixed - Updated express to 4.17.1 - Minor formatting in schema.ts
* Specify version of node required to run * Update graphql and graphql-tools - Update graphql to 15.5.0 as per #18 suggested - Update graphql-tools to 7.0.4 as #30 suggested - Ran npm ci to recreate package-lock to v2 * Update apollo-server-express - As per the suggestion in #70, applied version 2.24.0 - Added version of static types until DefinitelyTyped/DefinitelyTyped#49595 is fixed - Updated express to 4.17.1 - Minor formatting in schema.ts * Fix outdated package-lock file
This worked for me for |
Setting resolution to A more permanent fix would be for |
For me version |
The pull request created by @RMacfarlane triggered a test that basically said "these versions should not be specified"
The messages does not explain why this should not be done, and I can't find the source for this message. There is an issue that explains the problem with specifying everything as "*" that also suggest to lift this restriction, but there has been no response since October 2019. How can this be fixed then? |
it does solve the issue 😃 |
|
"express": "^4.17.1", deleted my package.lock.json and fresh |
works I have
|
No description provided.
The text was updated successfully, but these errors were encountered: