No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Can't find self.__WB_MANIFEST in your SW source. (quasar app v2)

    Help
    3
    3
    2651
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Q
      qLvoe last edited by qLvoe

      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

      1 Reply Last reply Reply Quote 1
      • S
        silvestrer last edited by

        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

        1 Reply Last reply Reply Quote 2
        • Kirschkern
          Kirschkern last edited by Kirschkern

          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!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post