moving between webpack and vite breaks PWA update process #14046
-
I am almost complete with my transition from webpack to vite, but there is a final sticking point. My PWA update process no longer works. Previously my
Now, nothing happens, no dialog is presented ever. The app will update/install if I clear cache or force a reload, but there is no message to users as before. I did not change this file from webpack to vite, is there something I need to change? here is the file:
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
So I have done some more testing and narrowed it down to this:
|
Beta Was this translation helpful? Give feedback.
-
Even worse, a previously saved to the home screen PWA on iOS will NEVER update, leaving the app in a previous version forever. The only way around this is to delete the pwa and reinstall |
Beta Was this translation helpful? Give feedback.
-
Is the no way to migrate from webpack to vite and have updates work? |
Beta Was this translation helpful? Give feedback.
-
I am really stuck with this. I can't have all my users have a broken update process, and force every one of them to have to clear their cache or force reload. Is there no way around this or am I stuck forever on webpack? |
Beta Was this translation helpful? Give feedback.
-
Ok, I found a solution! I began by painstakingly reviewing the build output differences between workbox and vite, and I noticed that the default name for the service worker file CHANGED in quasar config from |
Beta Was this translation helpful? Give feedback.
Ok, I found a solution! I began by painstakingly reviewing the build output differences between workbox and vite, and I noticed that the default name for the service worker file CHANGED in quasar config from
service-worker.js
tosw.js
. This totally breaks the update process. Changing thequasar.config.js
file from its defaultswFilename: 'sw.js'
toswFilename: 'service-worker.js'
fixes this. I feel like there should be a BIG warning when moving to vite to check this if you are not starting from scratch. I will make a PR for the docs.