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 PWA

    Error :
    • Compiling:
    └── PWA ████████████████████ 100% done in 21192 ms

    App · ⚠️ 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


Log in to reply