koji98
koji98

Reputation: 35

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

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?

Upvotes: 1

Views: 4949

Answers (2)

Ashwini
Ashwini

Reputation: 1

Check if the URL is blocked by your CORS policy.

Upvotes: 0

Jeff Posnick
Jeff Posnick

Reputation: 56144

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.

Upvotes: 1

Related Questions