-
-
Notifications
You must be signed in to change notification settings - Fork 240
Compression middleware causes TypeScript typing error #223
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
Comments
cc @RobinTail @hichemfantar Can you help us here, please? It looks like it's just a type error. |
I believe it's important to reflect versions of the dependencies in that case
I'm gonna try to make a smaller code sample that could possibly reproduce the issue, @bjohansebas |
I found the cause — it's the duplicated types of express having different versions, @rjray && @bjohansebas
|
Here is what fixes the issue in your project, @rjray Add the following lines to your "resolutions": {
"**/@types/express": "^4"
}, |
Perfect, that worked. Thank you! |
@RobinTail thanks for the help. since the new version of Express types was released, the ecosystem has been splitting a bit due to differences in types and versions. |
thanks for the fix @RobinTail hopefully these issues will go away once we start bundling types with express |
I'm not sure @hichemfantar , "dependencies": {
"@types/express": "*"
}, |
Using Express and Compression in a TypeScript project, I see the following error in VS Code:
Environment information
Version:
Platform:
Linux tremere 6.11.0-19-generic #19~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Feb 17 11:51:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Node.js version:
v22.12.0
Any other relevant information:
This only surfaced a month or two ago, after not being an error. The application does actually work, with compression enabled (tested in an API test utility). It's just the erroneous error flag that is an issue.
What steps will reproduce the bug?
I have reproduced this on both the Linux system I am currently using, and on MacOS. The repo that is exhibiting this is rjray/smdb, specifically the
server
sub-project.The
app.ts
file in which this occurs is attached (asapp.ts.txt
due to GH limitations).app.ts.txt
The text was updated successfully, but these errors were encountered: