Closed japereira94 closed 4 months ago
You want to add a subpath to the service worker script like [host]/[subpath]/firebase-messaging-sw.js. Can you confirm?
We can add a new config option (e.g. serviceWorkerRoute
) with default to /firebase-messaging-sw.js
.
I have a nuxt app that is deployed to a subfolder "example". When opening the app I get the following message.
FirebaseError: Messaging: We are unable to register the default service worker. Failed to register a ServiceWorker for scope ('[HOSTNAME]/firebase-cloud-messaging-push-scope') with script ('[HOSTNAME]/firebase-messaging-sw.js'): A bad HTTP response code (404) was received when fetching the script. (messaging/failed-service-worker-registration).
Is there a way to configure this to use a subfolder as the baseURL is configured like this?