axios HTTP Origin: Network OSI layer 7 · Application Last updated 18 Nov 2026

Axios "Network Error" with no response (CORS, DNS, offline or mixed content)

Axios shows a generic Network Error and error.response is undefined, so there is no status code to inspect.

Exact message you may see AxiosError: Network ErrorNetwork Error axiosAxiosError ERR_NETWORKError: Network Error at createErroraxios error.response undefined
Seen on: JavaScript HTTP

Meaning

The browser blocked or failed the request before any HTTP response: CORS failure, DNS/offline, TLS or mixed-content problems, an ad blocker, or a server crash with no reply. Open the DevTools Network and Console tabs for the real reason; error.response is only set when the server replied.

Common causes

  • CORS blocked the response
  • Server unreachable, DNS or TLS failure
  • Mixed content (HTTP API from HTTPS page)
  • Ad blocker/extension blocking the URL
  • Server crashed or closed the connection

⚡ Quick fix

  1. Check the browser console for the CORS/mixed-content message
  2. Test the URL with curl
  3. Handle error.response, error.request, error.code separately

Detailed fix by platform

JavaScript

  1. javascript
    try { await axios.get(url); } catch (e) {
      if (e.response) console.log(e.response.status); else console.log(e.code, e.message);
    }

How to diagnose

  1. error.response — Undefined?
  2. Console — Shows CORS?
  3. curl — Works?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

405 — 405 Method Not Allowed on OPTIONS (CORS preflight) (HTTP)405CORS — CORS Error: No 'Access-Control-Allow-Origin' header is present (API)CORSCORS — CORS: wildcard '*' not allowed when the request's credentials mode is 'include' (HTTP)CORSCORS — CORS: Redirect is not allowed for a preflight request (HTTP)CORSCORS — CORS: Private Network Access preflight blocked (public site calling localhost/intranet) (HTTP)CORSCORS — CORS: The 'Access-Control-Allow-Origin' header contains multiple values (HTTP)CORSCORS blocked (Laravel API) — Browser: Access to XMLHttpRequest at 'https://api.example.com' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header — Laravel (Laravel)CORS blocked (Laravel…CORS on errors — CORS error hides the real failure: Access-Control-Allow-Origin is missing on 4xx/5xx responses (HTTP)CORS on errorsaxios

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.