vite-plugin-pwa
vite-plugin-pwa copied to clipboard
Preload response
I get this error in console and in network, I see that a Preload request was canceled to my app shell page.
The service worker navigation preload request was cancelled before 'preloadResponse' settled. If you intend to use 'preloadResponse', use waitUntil() or respondWith() to wait for the promise to settle.
What sort of thing is this caused by?
@mastercoms you should ask/check these questions on workbox repo: https://github.com/GoogleChrome/workbox/issues/2178
I'm having a hard time transferring this issue to what I have in my VitePWA config. I mean, is there any config this is related to? globPatterns? manifest entries?
I'm not using a custom sw.js, just the one generated by this plugin, which is why I ask.
@mastercoms I need some repro or your pwa plugin configuration: it seems you've a navigation preload and maybe blacklist entry configured
You can try to add sourcemap, don't minify the build then take a look the sw generated by workbox, check the linked issue if it is the same problem, it can be a bug on workbox
https://github.com/mastercomfig/comfig-app/blob/develop/astro.config.mjs
@mastercoms is this a copy of my PR on astro (I need to change a few things)?
Anyway, the problem can be related to https://github.com/antfu/vite-plugin-pwa/pull/306, since the workbox generatedSW call doesn't include the claims stuff, check this entry on îles to solve it:
https://github.com/ElMassimo/iles/blob/main/packages/pwa/src/pwa.ts#L37
EDIT: just include both entries on the pwa configuration under workbox entry (you need to add it):
workbox: {
clientsClaim: true,
skipWaiting: true,
}