You mention that you have service-worker.js
in the same directory as app.js
, but the URL passed to .register()
is relative to the HTML document’s path. You need to make sure your service-worker.js
file is in the same directory as the .html
file corresponding to the page you’re on.