However, when run the service worker is successfully registered and subscribed to on /, but for every other route it attempts to find the service worker at the parent route. For example:
/users (and other top-level routes) works as it registers on / with /sw-[hash].js
/users/wopian registers a service worker on /users/ with /users/sw-[hash].js and errors*
/users/wopian/library registers a service worker on /users/wopian/ with /users/wopian/sw-[hash].js and errors*
* This leaves behind a redundant service worker registered to the parent route (e.g /users on /users/wopian) and an error in console that the service worker registration encountered a HTTP 400 response. This adds up to a lot of redundant service workers with either multiple refreshes or landing on different routes.
With swDest set to /sw.js, an absolute path, I would have expected all routes to register a service worker to / (e,g /users/wopian/library registers /sw-[hash].js.
The built service worker is only located at /sw-[hash].js.
Edit: The default swDest of ./sw.js tries to request the same service worker paths as /sw.js
I have
ember-cli-workbox@1.2.0
setup with the following configuration:However, when run the service worker is successfully registered and subscribed to on
/
, but for every other route it attempts to find the service worker at the parent route. For example:/users
(and other top-level routes) works as it registers on/
with/sw-[hash].js
/users/wopian
registers a service worker on/users/
with/users/sw-[hash].js
and errors*/users/wopian/library
registers a service worker on/users/wopian/
with/users/wopian/sw-[hash].js
and errors** This leaves behind a
redundant
service worker registered to the parent route (e.g/users
on/users/wopian
) and an error in console that the service worker registration encountered a HTTP 400 response. This adds up to a lot ofredundant
service workers with either multiple refreshes or landing on different routes.With
swDest
set to/sw.js
, an absolute path, I would have expected all routes to register a service worker to/
(e,g/users/wopian/library
registers/sw-[hash].js
.The built service worker is only located at
/sw-[hash].js
.Edit: The default
swDest
of./sw.js
tries to request the same service worker paths as/sw.js