Build your first progressive web app with React
Scott Domes

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) {` …