-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Closed
Description
Hello,
Axios cancels all subsequent requests after calling the initial requests during ComponentWillMount() phase of the ReactJS life cycle.
Afterwards, the requests are immediately canceled. Doesn't matter what phase of the ReactJS lifecycle they are called.
This only occurs when running on Electron. This problem does not persist on browser. I suspect the issue is caused by this:
if (typeof XMLHttpRequest !== 'undefined') {
// For browsers use XHR adapter
axios.defaults.adapter = xhrAdapter
} else if (typeof process !== 'undefined') {
// For node use HTTP adapter
axios.defaults.adapter = httpAdapter;
}
As the browser is correctly using the xhrAdapter and Electron is not using the httpAdapter. I came across a similar issue that was closed, and after following the solution, I was able to get the request to send for approx. <15 seconds before the requests started to immediately cancel again.
- axios version: "0.16.2",
- Environment: Node v6.11.3 Chrome 61, Windows 10*
- Network output from Developer Console
Metadata
Metadata
Assignees
Labels
No labels