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 gives a 504 error on a Windows VM #1021
Comments
That warning means that the Promise is getting rejected - you should attach a rejection handler to catch it and see what the error is
|
@ZhangYiJiang, thanks for helping out. I am now catching and logging the error returned by axios. It says:
Unfortunately, there is no circular structure in the returned JSON. I can hit the same URL from the browser and I get simple objects with two properties (id and name):
|
If I put a breakpoint in the catch clause, and inspect the error object, I am getting a 504 error from a gateway inside the firewall. The response is an HTML page displaying the 504 error. I wonder the app it is trying to reach an outside port instead of localhost where the server is running. |
Ok, I think I have determined the root cause of this issue, but don't know the solution. The Windows VM has HTTP proxy settings by setting the environment variable So the question is, should Axios be going through the proxy to access local ports when BTW, node-fetch seems to be ignoring the |
After a bit of research, I found that I should set
Unfortunately that doesn't work. Then I stumbled across #434 which has been open since Sep, 2016. Furthermore there is a PR for it, ready to be merged since Dec, 2016: #565. I am baffled why something as important as this has not been merged in 8 months! My faith in Axios is shaken :-(. Please prove me wrong. |
We'll review that PR so I'm closing this as duplicate. |
#### Summary
The following node.js app using Axios works correctly on Windows and Mac:
However, if I run it on a Windows 7 or Windows 10 VDI (essentially a virtual machine), it fails with the following error message:
If I replace the axios call with node-fetch, the error goes away and the fetch works. What could be the problem with axios or the way I am using it?
#### Context
The text was updated successfully, but these errors were encountered: