-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
await axios.get() Never Resolves #4672
Comments
I have exactly the same issue with .post method... |
I have same issue. I'm using axios.request() method for GET request. The script just hangs after calling this method. Even calling process.exit() doesn't work if you put it after await axios.request() |
Same experience. But in a mind boggling twist - this call ran fine until today. I have no idea what changed. I did not update any packages. Now this afternoon, axios never resolves the promise of a simple get call. Same call works fine in postman. |
Well, turns out mine wasn't an Axios issue at all. I had made an unrelated change to a react component that was resulting in infinite re-render loops - so the code just never had the chance to run the promise resolution. |
For us, the same behavior happens, pretty much irregularly. In most cases after the user become online again (might not be related, yet that's the only breadcrumbs we see) |
I've experienced the same issue which seems to happen intermittently. The request is made, but then it fails to receive the full response and no error is thrown - the process just hangs indefinitely. Tried debugging on a patched axios 1.6.2 with a bunch of console.logs inside lib/adapters/http > req = transport.request(options, function handleResponse(res){}): This is a get request and the response is gzip encoded.
The stream fails to then receive any further chunks. When setting a timeout in the axios config this also never seems to trigger if the first chunk has already been received (seems to be expected behavior per #5886) If I set So for the timebeing a workaround seems to be setting an empty onDownloadProgress config option. |
Describe the issue
When calling axios.get() in an async function, passing in username and password authentication, intermittently the request will hang and never resolve.
Using the axios-debug-log package, I can see that Axios places the get request correctly, however, no response is ever returned. Nor is an error thrown.
This issue had also been found when using axios.get() to return an array buffer, however, I used a write stream as a temporary workaround for that case scenario.
Example Code
Expected behavior, if applicable
axios.get() to resolve its request, and return the response to the data constant.
I have tried both in Postman [9.17.1], Chrome [100.0.4896.127], and the vanilla Node.js HTTP package and was able to consistently make these GET requests. The problem only arises when utilizing Axios.
Environment
Additional context/Screenshots
The text was updated successfully, but these errors were encountered: