pwa whit custom-service-worker.js
-
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
-
I want to mention that I installed:
yarn add --dev workbox-webpack-plugin@^5.0.0 -
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
-
@TJose why would you do that? Quasar v1 has workbox v4. Quasar V2 has workdbox v5
-
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:- What I mention here about the custom-service-worker
- Another one that I consulted in another thread about localforage (I solved it using localstorage)
-
@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…
-
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?
-
@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.