motia/quasar-app-extension-firebase-messaging

firebase-messaging-sw.js in subfolder?

ngekoding opened this issue · 2 comments

Hi, thanks for this awesome work.

I was integrating this and found the error after build, because the app trying to find firebase-messaging-sw.js in root, but my app in subfolder.

Here the app url: domain.com/my-app

How can I solve this?

motia commented

Hi,
You could try to add the subdirectory as a prefix to the path here:

scripts.unshift('/service-worker.js?' + Date.now())

// replace line
register(process.env.SERVICE_WORKER_FILE, {
--->
// by
register(`${subdirectory}/firebase-messaging-sw.js`, {

Let me know if it works

Thanks for the reply, but still not working.
When checking the Console, the error says that the app trying to find /service-worker.js (root)