diff --git a/src/swRegistration.ts b/src/swRegistration.ts index 927cba6..a2d0622 100644 --- a/src/swRegistration.ts +++ b/src/swRegistration.ts @@ -23,7 +23,7 @@ export function register(config?: Config) { } window.addEventListener('load', () => { - const swUrl = `./sw.js`; + const swUrl = new URL('sw.js', publicUrl.href).href; if (isLocalhost) { // This is running on localhost. Let's check if a service worker still exists or not.