Can't find self.__WB_MANIFEST in your SW source. (quasar app v2)
-
Hello,
On the latets quasar app (2.0.0 or 2.0.1) i have this error when InjectManifest mode PWAError :
• Compiling:
└── PWA ████████████████████ 100% done in 21192 msApp ·
️ 1 error encountered:
Can’t find self.__WB_MANIFEST in your SW source.
App ·
️ [FAIL] Build failed with 1 error. Check log above.
FRESH quasar last versions of : quasar, @quasar/cli, @quasar/app
pwa: { workboxPluginMode: "InjectManifest", // 'GenerateSW' or 'InjectManifest' workboxOptions: {}, // only for GenerateSW manifest: { name: "name", short_name: "snm", description: "mydesc", orientation: "portrait", background_color: "#1e1d32", theme_color: "#292845", start_url: "/", icons: [ { src: "icons/icon-128x128.png", sizes: "128x128", type: "image/png", }, { src: "icons/icon-192x192.png", sizes: "192x192", type: "image/png", }, { src: "icons/icon-256x256.png", sizes: "256x256", type: "image/png", }, { src: "icons/icon-384x384.png", sizes: "384x384", type: "image/png", }, { src: "icons/icon-512x512.png", sizes: "512x512", type: "image/png", }, ], }, }, }
src-pwa :
- custom-service-worker.js (empty)
- register-service-worker.js (the default one generated by quasar) : …
=> register(process.env.SERVICE_WORKER_FILE, { … }
Thankyou
-
I solved this changing the file “custom-service-worker.js” adding:
import { precacheAndRoute } from ‘workbox-precaching’
precacheAndRoute(self.__WB_MANIFEST)font: https://github.com/GoogleChrome/workbox/issues/2519#issuecomment-634164566
-
I get the same error. Adding the lines @silvestrer suggested, didn’t change anything. Any help would be great!
The reason I want to use “InjectManifest” for the workboxPluginMode is to be able to use web push notifications. If there is another way of achieving it, I would be happy to read how it’s done.
Update:
I’ve cancelled the build process and restarted it ($ quasar dev -m pwa).
Now it works!