Open ricardomatias opened 1 year ago
What version of apollo client are you using? This error used to be caused by the lack of support for react 18.x but this got fixed in one of the recent'ish releases.
@JesseKoldewijn I'm using the latest version 3.7.16
In my case this happened when the server's content type header is not what actually is. For example the content type says it's gzip but the content is without compression, thus causing the decompression failed.
To exclude/verify if this is your case, you can add this header temporarily and try again:
"Accept-Encoding": "identity",
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue or a replay of the bug
null
To Reproduce
It's not trivial to create a reproducible example. All the details are in the description.
Describe the Bug
Issue Description
Summary
The following code used to work in NodeJS 16 (16.20.0 tested), but when trying to use it with NodeJS 18 there's the following error:
Error:
And the header in question:
This is the file that defines the authentication procedures and the only place I have any control regarding headers.
apollo.ts
I have a login page, that is able to fetch a cookie from the API endpoint, but then a subsequent request within
getServerSideProps
(more precisely,apolloClient.query
) triggers the error.Expected Behavior
That there are no zlib errors like with previous Node versions.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response