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
Axios 1.2.0 response data is unreadable #5328
Comments
@spellforce You could fix the problem quickly by adding |
I find it absolutely insane that a package this popular has such a major bug for 9 days and no one is doing s**t. |
Exactly, this is really getting ridiculous... Really not sure how this is even possible... |
It works. Thanks. |
The library is not stable at all, and there have been many obvious bugs before |
It works. Thank you. |
If a real fix (not a hack one XD ) is provided by the library tell me please :( |
@Apokalypt You can subscribe to this issue on the top right of the page. Then you will get notified when it is closed. |
I've lost 2 hours debugging existing code. Amazing bug. |
This issue will be fixed this weekend hopefully |
This addresses an issue in Axios 1.2.0 that causes data to be unreadable. See axios/axios#5328
* Work Around to Address Axios Issue This addresses an issue in Axios 1.2.0 that causes data to be unreadable. See axios/axios#5328 * lint
Same issue. You can fix for requests with accept-encoding, but not sure how to deal with post requests - these always seem to get compressed. For now switching back to 1.1.3. |
This is scary for two reasons: 1 it is a key problem (granted that there is a workaround), and 2 how come this version passed the regression testing (seems to be quite obvious to replicate)? |
It has a pretty bad bug (axios/axios#5328) where it will fail to decode responses that don’t have a Content-Length response header set; a fix is already committed, but not yet released. npm semver doesn’t have a syntax to exclude a specific version, but we can simulate it by combining two ranges. (It’s not clear whether the next axios release will be 1.2.1 or 1.3.0, but ^1.2.1 should match either.)
Use release 1.2.1 |
Yes. This is now fixed in 1.2.1 |
Please use 1.2.1 |
Describe the bug
code:
`const axios = require('axios');
axios
.request({
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false,
},
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
env: {
FormData: {
LINE_BREAK: '\r\n',
DEFAULT_CONTENT_TYPE: 'application/octet-stream',
},
Blob: null,
},
baseURL: 'https://baidu.com/',
method: 'get',
url: '/',
})
.then(function (response) {
console.log(response.data, 'response');
})
.catch(function (error) {
console.log(error);
});
`
To Reproduce
No response
Code snippet
No response
Expected behavior
No response
Axios Version
1.2.0
Adapter Version
XHR, HTTP
Browser
Nodejs
Browser Version
Nodejs
Node.js Version
16.17.1
OS
osx 13.1
Additional Library Versions
Additional context/Screenshots
![image](https://user-images.githubusercontent.com/12042870/205060898-a55b8da5-877a-49de-afda-b17e36de8a88.png)
The text was updated successfully, but these errors were encountered: