Noted from Register A service worker,
If we register the service worker file at
/example/sw.js
, then the service worker would only seefetch
events for pages whose URL starts with/example/
(i.e./example/page1/
,/example/page2/
).
Inline with the shown error and given in this documentation, check the following:
- Define a
start_url
property in yourmanifest.json
file.- Ensure that your service worker properly caches a resource that matches the value of
start_url
.
Also, check this tutorial and see if it will help you.