"Failed to fetch" / fetch failed

Also searched as: fetch failed

Updated 11 October 2026

Short answer

"Failed to fetch" (or TypeError: fetch failed in Node.js) means the request never produced a usable response. It's not an error status like 404 or 500, which would arrive as a normal response. The usual causes are: the server is unreachable or the network dropped, the browser blocked the request (CORS, mixed content, an ad blocker), or the URL is invalid. For security reasons the browser hides CORS details from your code, so check the browser console, which shows the real reason.

What's the problem

Your front end shows "Failed to fetch", "NetworkError when attempting to fetch resource", or "Load failed", or your Node.js code throws fetch failed.

Why it happens

  • The API is down or unreachable (wrong address, DNS failure, server off).
  • CORS: the API doesn't allow requests from your site's origin.
  • Mixed content: an HTTPS page calling an http:// API.
  • An ad blocker or privacy extension blocking the request.
  • An invalid URL, such as a missing https:// or a typo in an environment variable.
  • SSL problems on the API's certificate.

How to fix it

  1. Open the browser console (F12). It shows the real reason: CORS, mixed content, DNS, connection refused, or certificate.
  2. Open the API URL directly in a browser tab. If it doesn't load, the API itself is down or the address is wrong.
  3. For CORS, the API must send Access-Control-Allow-Origin for your site. See CORS error.
  4. For mixed content, call the API over https://.
  5. Check the URL your live build actually uses (environment variables differ between local and production).
  6. Test without extensions in a private window.

What Preventionlabs checks

One click runs the full report on your domain. For this problem it shows whether your site loads, how fast, and where its redirects go. With Cloudflare connected, it also shows which pages returned server errors (5xx) to visitors, and when; errors thrown by your Workers code; recent deploys and account changes, with their times. It doesn't call your API with your app's own requests or read your logs, so test the failing request directly as well.

Run your free report

Your first report is free, no card needed. Then A$50 a month, up to 10 domains. Read-only: it never changes anything.

Sources

  1. MDN Web Docs: Window: fetch() methodreferenceThere is a network error (for example, because the device does not have connectivity).
  2. MDN Web Docs: CORS errorsreferenceFor security reasons, specifics about what went wrong with a CORS request are not available to JavaScript code .
← All of API