Progressive Web App: The FetchEvent for "<URL>" resulted in a network error response: the promise was rejected

2.9k Views Asked by At

I am seeing the following errors in the console of my PWA:

  1. The FetchEvent for "https://static.cloudflareinsights.com/beacon.min.js" resulted in a network error response: the promise was rejected.
  2. The FetchEvent for "https://www.google-analytics.com/analytics.js" resulted in a network error response: the promise was rejected.

It seems that external scripts have problems being fetched by workbox? The website is a next.js app and i am using next-pwa to turn it into a PWA. Here is the pwa-config for next-pwa: next-pwa config

Does anyone know how to fix this?

2

There are 2 best solutions below

3
On BEST ANSWER

This is fairly common if you have a ad/tracking blocker extension installed, or if your browser has built-in blocking. A Workbox-powered service worker will not do anything to work around this blocking.

1
On

Check if the URL is blocked by your CORS policy.