Inside the DOMContentLoaded event, we need to ensure the service worker has been activated. We cannot use await serviceWorker.register() since we're in a function and the service worker is a module.
Using await to get the service worker registration doesn't seem to work either.
When first visiting, there is an error from the check to see if there is an installed instance:
Inside the
DOMContentLoaded
event, we need to ensure the service worker has been activated. We cannot useawait serviceWorker.register()
since we're in a function and the service worker is a module.Using
await
to get the service worker registration doesn't seem to work either.