Skip to content

upgrading @whatwg-node/server:0.10.3+ breaks express compression middleware #3997

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

Closed
meabed opened this issue Apr 15, 2025 · 9 comments · Fixed by ardatan/whatwg-node#2383
Closed

Comments

@meabed
Copy link

meabed commented Apr 15, 2025

Describe the bug

Last releases where the @whatwh-node/server upgraded to 0.10.3 breaks the compression middleware and hangs requests like introspection and other requests ( but not all )

Your Example Website or App

https://codesandbox.io/p/devbox/agitated-brahmagupta-p63ldq

Steps to Reproduce the Bug or Issue

Steps to reproduce:

Image
  • If we override the package version the application works fine
Image

After this the request works fine

Image

The other solution is to remove the compression middleware and it will work fine

Expected behavior

It should respond with the request correctly

Screenshots or Videos

No response

Platform

  • OS: any
  • NodeJS: 23
  • @graphql-yoga/* 5.13.3

Additional context

No response

@taybin
Copy link

taybin commented Apr 25, 2025

I am also running into this.

@AndreasMann92
Copy link

Very good report. It would have taken us much longer to figure this one out by ourselves. Thank you for bringing this to our attention. Hope this will get adressed properly.

@ardatan
Copy link
Member

ardatan commented May 5, 2025

This is a bug in compression package which proxies response.write incorrectly.
See more here;
ardatan/whatwg-node#2383

But we will still apply a workaround for it.

@Urigo
Copy link
Collaborator

Urigo commented May 6, 2025

@ardatan should there also be an open issue about that on the compression repo?

@ardatan
Copy link
Member

ardatan commented May 6, 2025

@Urigo There is one actually with a PR but it is there since 2016.
expressjs/compression#46

@Urigo
Copy link
Collaborator

Urigo commented May 6, 2025

haha wow that is old!

@meabed
Copy link
Author

meabed commented May 6, 2025

Ugh that's only 9yo 😂

Any alternative to compression maybe is the solution?

@ardatan
Copy link
Member

ardatan commented May 6, 2025

Actually there is a plugin for Yoga.
Sadly we haven't documented it yet in Yoga;

import { useContentEncoding } from '@whatwg-node/server';

createYoga({
  plugins: [
     // ...
    useContentEncoding(),
  ]
})

@meabed
Copy link
Author

meabed commented May 9, 2025

Thank you @ardatan 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants