Build your first progressive web app with React
Scott Domes
1.7K36

I’ve recently got the following error:
Failed to load resource: net::ERR_INSECURE_RESPONSE — service-worker.js

This is to do with the fact that we try to load the service-worker from a relative path, so this error will show up when we’re inside a different url path, e.g. /home/something

In order to solve it I just added %PUBLIC_URL% to:
`navigator.serviceWorker.register(‘%PUBLIC_URL%/service-worker.js’).then(function(registration) {` …

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.