-
-
Notifications
You must be signed in to change notification settings - Fork 11k
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
AxiosError: unexpected end of file #5346
Comments
Z_BUF_ERROR |
I've been having a similar issue downgrading to axios v1.2.0 will fix the problem Something is broken with Brotli decompression and I think the culprit is somewhere in this merge #5306 An alternative if you don't want to downgrade right now is to force an encoding header with axios.get("url", {
headers: { "Accept-Encoding": "gzip,deflate,compress" }
}); This should make the response use something other than the "br" brotli compression encoding |
Running it in a browser works fine, problem occurs running in nodejs const axios = require("axios");
axios
.get("https://www.speedwaymotors.com/", { headers: { "Accept-Encoding": "br" } })
.then((response) => console.log(response.data.length))
.catch((error) => console.error(error));
From a quick look I think newer versions of the Kestrel web server are compressing it differently? but curl handles it correctly pinging @DigitalBrainJS and @jasonsaayman as this is big problem and should implement fix quick or remove v1.2.1 until it's production ready changing https://github.com/axios/axios/blob/v1.x/lib/adapters/http.js#L430 from: Fixes the problem |
We have the same problem as @robwilkes: we just tried to upgrade from 1.1.3 to 1.2.1 and we got the "unexpected end of file" error thrown by the brotli decompression. We are calling a .NET 6 API from NodeJs using Axios. Version 1.1.3 works ok, 1.2.0 returns something unusable and 1.2.1 throws the error. @Flupster might be right with the Kestrel part. |
Same here, got the problem with 1.2.1 when using the |
I get it while I am doing processing with an FFmpeg spawn process and a request is made with Axios, downgrading to 1.13 seems to fix it |
Same problem, even with an incredibly simple call:
This works flawlessly on 1.1.3 Broken on 1.2.0 due to the content-header problem, broken now on 1.2.1 due to this "unexpected end of file" error. |
I just ran into this issue with version 1.2.1. Do you have a fix planned? |
I was pulling my hair out getting the Z_BUF_ERROR thrown by Axios for otherwise successful POST requests to an external API for my Node project. Downgrading to 1.1.3 resolved the issue. |
This is actually third time (most of any open source library) axios broke all my production apps 😢 |
I'm puzzled on how consecutive bad versions got released on such a popular library, are there more tests we could help add to prevent these? |
I think we can try to get a stream from Axios response when you are not supposed to get JSON, and then process that stream. At least for me that workaround worked fine |
* version upgrade 3.0.1 > 3.0.2 * bundle file extension change * cjs/index.js > cjs/index.cjs * esm/index.js > esm/index.mjs * production build apply terser * axios version fixed: 1.1.3 * axios/axios#5346
* version upgrade 3.0.1 > 3.0.2 * bundle file extension change * cjs/index.js > cjs/index.cjs * esm/index.js > esm/index.mjs * production build apply terser * axios version fixed: 1.1.3 * axios/axios#5346
Read more: axios/axios#5346
It works after I downgraded to |
looks like the issue is still ongoing when i try to use Axios for the 1st time, I guess I will go back to the vanilla fetch method. |
This is still an issue for me, quite surprising to see no resolution despite the module's popularity |
fixes issue described here: axios/axios#5346
This was fixed in v1.2.2. |
Describe the bug
AxiosError: unexpected end of file
Was not present before 1.2.1
To Reproduce
No response
Code snippet
No response
Expected behavior
No response
Axios Version
1.2.1
Adapter Version
No response
Browser
No response
Browser Version
No response
Node.js Version
No response
OS
No response
Additional Library Versions
No response
Additional context/Screenshots
No response
The text was updated successfully, but these errors were encountered: