Open lukadriel7 opened 1 year ago
Hi,
While in development mode, almost nothing is precached by the service worker (other than the public folder) because otherwise that will interfere with the source files and will make development very hard, especially when HMR is involved. However, a service worker is still needed and being used (albeit a dumb version of it) so that you the developers can still develop and test the interaction with it through src-pwa/register-service-worker.[js|ts]. It's better to explain this with code rather than words, since there are two ways to configure a PWA (InjectManifest and GenerateSW), so looking at the following file will shed some light on what's going on: https://github.com/quasarframework/quasar/blob/dev/app-vite/lib/modes/pwa/pwa-config.js
For production mode, the index.html is cached and you can see this on Quasar's documentation as well (although docs use SSR+PWA, not just PWA alone, but the same principle applies).
Having the same problem in dev mode. The workaround worked for me
@kevinmelo have you solved this am having the same issue
@kevinmelo have you solved this am having the same issue
At the end i had to ignore the error in localhost. The pwa still work. The "workaround" i made was broking in production.
Thanks I will try your way to see if I have any luck
On Tue, Sep 3, 2024, 12:16 Kevin de Melo @.***> wrote:
@kevinmelo https://github.com/kevinmelo have you solved this am having the same issue
At the end i had to ignore the error in localhost. The pwa still work. The "workaround" i made was broking in production.
— Reply to this email directly, view it on GitHub https://github.com/quasarframework/quasar/issues/15030#issuecomment-2326142760, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYFT4WTVHRLGKKI4CYLMWBLZUWD6ZAVCNFSM6AAAAAASRJAKISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRWGE2DENZWGA . You are receiving this because you commented.Message ID: @.***>
What happened?
The default implementation of custom-service-worker uses a fallback code to index.html . However the service worker doesn't cache the index.html file causing the installation to fail. I currently use the following code in quasar.config.js file to fix the issue:
What did you expect to happen?
The index.html file should be included in the cached asset of self.__WB_MANIFEST
Reproduction URL
https://stackblitz.com/edit/quasarframework-xotzmd
How to reproduce?
quasar dev -m pwa
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
PWA Mode
Platforms/Browsers
Chrome
Quasar info output
Relevant log output
Additional context
No response