ErrorBellFree

Error library / this error

How to fix it

TypeError: Failed to fetch

What it means

The request never got a usable response. The browser gives one vague message for many different causes.

Common causes

  • The server is down, the address is wrong, or you are offline.
  • CORS blocked the response (check the console for a separate CORS message).
  • An ad blocker or extension cancelled the request.
  • Mixed content: an HTTPS page calling an HTTP address.
  • A certificate problem on the API host.

How to fix it

1. Open the Network tab

Find the request. A red row with no status means it never completed; look at the reason in its details.

2. Check CORS and HTTPS first

They cause most cases on a new project. See the CORS and mixed content entries.

3. Retry with a clear message for users

try { await fetch(url); }
catch { showToast('Could not reach the server. Check your connection.'); }

Catch it the moment it happens

ErrorBell shows a dot on the page when this error occurs and takes you to the failing line, so you do not have to hunt through the console. Add it to Chrome, it is free.

Related errors