🌐Couldn't send the request (Failed to fetch)
TypeError: Failed to fetch
A request was sent to the server, but no response came back at all. The server is down, the address is wrong, or something blocked it on the way.
🤔 Why does it happen?
- The request address (URL) is wrong, or the server is down
- The deployed site is calling an address on your own computer (localhost)
- The browser blocked it because of CORS or http/https
- The internet connection dropped
🔧 Try this
- Put the request address straight into the browser's address bar and see if it opens
- Search the code for any leftover localhost addresses
- Check the console for other errors that showed up with it (CORS, Mixed Content)
🤖 Ask your AI like this
I get 'TypeError: Failed to fetch' when I call [which URL] with fetch. Please check one by one whether the cause is the request address, the server's state, CORS, or http/https, and fix it. Make sure it uses the right address on the deployed site too.
Replace the [ ] parts with your own situation, and paste the error with a few extra lines before and after it.
Related terms
Other errors in this group
- Page not found (404)
404 Not Found - Internal server error (500)
500 Internal Server Error - Authentication failed (401)
401 Unauthorized - No permission (403)
403 Forbidden - Too many requests (429)
429 Too Many Requests - CORS error (cross-site request blocked)
blocked by CORS policy - Connection refused (localhost refused to connect)
ERR_CONNECTION_REFUSED - Mixed content (http request on an https page)
Mixed Content - Request method not allowed (405)
405 Method Not Allowed - What you sent is too big (413)
413 Payload Too Large - The middle server got no answer (502)
502 Bad Gateway - Service temporarily unavailable (503)
503 Service Unavailable - Redirects loop forever (too many redirects)
ERR_TOO_MANY_REDIRECTS - Blocked by an ad blocker
net::ERR_BLOCKED_BY_CLIENT - An image or file won't load
Failed to load resource: 404 (Not Found)