Next.js Discord

Discord Forum

Getting err_content_decoding_failed in production only, hosted on Vercel

Unanswered
Yellow and black potter wasp posted this in #help-forum
Open in Discord
Yellow and black potter waspOP
I am hosting my app on Vercel, and I'm getting "err_content_decoding_failed" errors on API-calls, but only on my production deployment. Dev and preview works fine.
I've noticed that on the production system the api-calls are getting several headers in the response that seem to be CloudFlare related (cd-cache-status, cf-ray, and a cf-related set-cookie), as well as a "content-encoding: br" header.
I suspect the issue might be related to the content-encoding, but adding "accept-encoding" headers to the requests does not affect the returned content-encoding header.

This occurs regardless of whether I point the backend at our dev- or production-backends.
Right now this issue is blocking a client-delivery, which makes it quite urgent for us to find a solution.

As mentioned, the project is hosted on Vercel.
It is built and deployed using a gitlab-job that essentially does
- vercel build --prod
- vercel deploy --prebuilt --prod

And that does the same for staging (except without the --prod) flag.
I can't see anything in the online vercel configuration that could affect this.

1 Reply

Yellow and black potter waspOP
I have tried turning compression off in the next.config.js file (compress: false), but that has not affected anything. Including that the content is still with content-encoding: br