Receiving ERR_NETWORK suddenly on axios.get request
Problem
Describe the issue Roughly a month ago I started receiving an `ERR_NETWORK` response from my `axios.get` (and `axios.post`) requests. I have no idea what is causing this because nothing on the server it's requesting (I have access to the API server as well) has changed and nothing in my request has changed either. I'm using Vue 3 in Electron. I can make the request with the same URL and headers in PostMan and receive the correct response. When I build my app for production, the request works completely fine, but when it's in development mode, I receive these errors on any of the API calls and I have no idea what's going on. I receive the following errors in my console after the request fails - `Access to XMLHttpRequest at 'DOMAIN' from origin 'http://localhost:8080' has been blocked by CORS policy: Request header field accesstoken is not allowed by Access-Control-Allow-Headers in preflight response.` `GET DOMAIN net::ERR_FAILED` `{ "message": "Network Error", "name": "AxiosError", "stack": "AxiosError: Network Error\n at XMLHttpRequest.handleError (http://localhost:8080/js/chunk-vendors.js:24846:14)", "config": { "transitional": { "silentJSONParsing": true, "forcedJSONParsing": true, "clarifyTimeoutError": false }, "adapter": [ "xhr", "http" ], "transformRequest": [ null ], "transformResponse": [ null ],
Error Output
Error: Network Error\n at XMLHttpRequest.handleError (http://localhost:8080/js/chunk-vendors.js:24846:14)",
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Receiving ERR_NETWORK suddenly on axios.get request
Similar problem we are facing too, and its happening only 2-3% of the time
Trust Score
6 verifications
- 1
Similar problem we are facing too, and its happening only 2-3% of the time
Similar problem we are facing too, and its happening only 2-3% of the time
Validation
Resolved in axios/axios GitHub issue #5644. Community reactions: 22 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep