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

    pwa whit custom-service-worker.js

    Framework
    3
    8
    441
    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.
    • T
      TJose last edited by

      Hi all

      In branch 1.x when I use src-pwa/custom-service-worker.js workbox is injected, then:

      if (workbox) {
        ...
      }
      

      but not in the 2.x branch. I get ‘workbox’ is not defined.

      pwa: {
          workboxPluginMode: 'InjectManifest', // 'GenerateSW' or 'InjectManifest'
          workboxOptions: {}, // only for GenerateSW
          ...
      }
      

      I tried importScripts but I get ‘importScripts’ is not defined
      How do you do this in branch 2.x?

      Jose

      1 Reply Last reply Reply Quote 0
      • T
        TJose last edited by

        I want to mention that I installed:
        yarn add --dev workbox-webpack-plugin@^5.0.0

        dobbel 1 Reply Last reply Reply Quote 0
        • A
          andercard last edited by

          Tengo el mismo error

          intento con y tamcompo funciona

            workboxPluginMode: 'InjectManifest', // 'GenerateSW' or 'InjectManifest'
            workboxOptions: {
              swSrc: './src-pwa/custom-service-worker.js'
            }, // only for GenerateSW
          1 Reply Last reply Reply Quote 0
          • dobbel
            dobbel @TJose last edited by dobbel

            @TJose why would you do that? Quasar v1 has workbox v4. Quasar V2 has workdbox v5

            https://quasar.dev/start/release-notes

            1 Reply Last reply Reply Quote 0
            • T
              TJose last edited by

              Hello dobbel, I don’t understand the question.
              I am trying to migrate my pwa, which works fine on branch 1.x, to branch 2.x. I followed all the instructions given in [1] and I am missing two things to make it work:

              1. What I mention here about the custom-service-worker
              2. Another one that I consulted in another thread about localforage (I solved it using localstorage)

              [1] https://quasar.dev/quasar-cli/app-upgrade-guide

              dobbel 1 Reply Last reply Reply Quote 0
              • dobbel
                dobbel @TJose last edited by dobbel

                @TJose ah I see you are right. Can’t help with workbox v5 or Q v2. But reading the migration guide It says you could also install workbox v4…

                1 Reply Last reply Reply Quote 0
                • T
                  TJose last edited by

                  Hi @dobbel I Uninstall version 5 and install version 4 and now it works fine. So the query now how should I do if I wanted to use version 5?

                  dobbel 1 Reply Last reply Reply Quote 0
                  • dobbel
                    dobbel @TJose last edited by dobbel

                    @TJose I would create a new project with Q v2 and make a quick setup to check if the pwa functionality then does work. If it works , than I would look for differences between the 2 apps.

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