What can cause Chrome to give an net::ERR_FAILED on cached content against a server on localhost? What can cause Chrome to give an net::ERR_FAILED on cached content against a server on localhost? google-chrome google-chrome

What can cause Chrome to give an net::ERR_FAILED on cached content against a server on localhost?


I run into similar problem. I have copied request as fetch in Network tab in devtools.

Then I have run it in browser dev console. There I could read description of the error about CORS. After setting cors on the api server, it worked.

You have to paste the fetch command into the dev console of the same origin and NOT accidentally e.g. open it from stackoverflow.


Another cause is, when you use withCredentials: true (sending cross origin cookies) for XHR calls, you are not allowed to set Access-Control-Allow-Origin: *, but have to provide a specific domain!

Sadly, you cannot use a list of domains here, because no browser supports this official standard. But several frameworks, like Spring, allow you to set a whitelist configuration, which then is matched on request.

See also:


One very important and un-loved comment in this set of answers is, "Look at your CORS headers." I had a problem much like this, and it gave me this error with some prodding. No data in my Apache logs, but I noticed that we were calling a secondary URL and getting no response for that secondary URL.

Chrome didn't initially call it a CORS issue, but lack of response caused me to dig into our Apache settings and change the allowable CORS source header.

<Directory /var/www/>        Options Indexes FollowSymLinks        AllowOverride None        Require all granted        Header set Access-Control-Allow-Origin "https://our-site.com"        Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"        Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"</Directory>

This answer may not apply to YOUR situation, but it applied to my net::ERR_FAILED