Workbox options are added to workbox.core instead of workbox
See original GitHub issueAlthough I am sure some workbox options should indeed be added to workbox.core, others that are standard (such as skipWaiting and clientsClaim) should instead be added to workbox top level.
To Reproduce Steps to reproduce the behavior:
- Go to
quasar.conf.jsand addworkboxOptions: { skipWaiting: true }underpwa - load pwa in web browser
Expected behavior That the option will be properly added
Actual behavior
Option is not loaded and browser throws an error:
Uncaught TypeError: workbox.core.skipWaiting is not a function
This is because not all options are appropriate to add to core, some (like skipWaiting) should be added above. The correct option should be workbox.skipWaiting()
Workaround Create custom service worker file and add options manually.
Possible Solution
Perhaps there should be two options available in quasar.conf.js, one for workboxCoreOptions and one for workboxOptions? Or some warning about invalid options?
btw, here is my quasar config info: Operating System - Darwin(18.7.0) - darwin/x64 NodeJs - 11.11.0
Global packages NPM - 6.10.3 yarn - Not installed @quasar/cli - 1.0.0 cordova - 8.1.2 (cordova-lib@8.1.1)
Important local packages quasar - 1.1.0 – Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time @quasar/app - 1.0.5 – Quasar Framework local CLI @quasar/extras - 1.3.1 – Quasar Framework fonts, icons and animations vue - 2.6.10 – Reactive, component-oriented view layer for modern web interfaces. vue-router - 3.1.2 – Official router for Vue.js 2 vuex - 3.1.1 – state management for Vue.js electron - Not installed electron-packager - Not installed electron-builder - Not installed @babel/core - 7.5.5 – Babel compiler core. webpack - 4.39.3 – Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, … and your custom stuff. webpack-dev-server - 3.8.0 – Serves a webpack app. Updates the browser on changes. workbox-webpack-plugin - 4.3.1 – A plugin for your Webpack build process, helping you generate a manifest of local files that workbox-sw should precache. register-service-worker - 1.6.2 – Script for registering service worker, with hooks
Quasar App Extensions @quasar/quasar-app-extension-icon-genie - 1.0.1 – A Quasar CLI Extension for Making All Your Icons
Networking Host - ssuess-pro en0 - 193.0.21.19 utun3 - 10.245.2.181
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)

Top Related StackOverflow Question
Hi @ssuess ,
I just tested with quasar/app 1.0.5 (that you also have), and seems to be working correctly (no errors).
At best, this would be an error to report to workbox for their workbox-webpack-plugin. All options are passed to their plugin, and if the plugin does not generate the right content, it can only be due to a problem in their package. But I tested it and no error pops out.
Here’s the generated service-worker.js file (stripped out comments):
Are you sure that you are testing the right URL with the latest generated service worker? Might happen, who knows… Any cache issues somehow on the workbox-sw.js from above? If you can confirm that you have eliminated this chance, can you share a reproducing repo pls? I’ve tested and tested and couldn’t reproduce. Thanks!
Interesting… then it’s definitely something related to how yarn/npm managed the packages. Will close this, but please do share your findings here.