Closed DidoMarchet closed 2 months ago
Since you're using ssr, you need to prerender the navigate fallback page, sw precaching (offline support requires an inital html page). Check the sveltekit issue, the nuxt repos and the discussion in this comment: https://github.com/vite-pwa/sveltekit/issues/65#issuecomment-2256556810
Ok thanks I solved in this way:
Pwa module configuration:
// https://github.com/vite-pwa/nuxt
// https://github.com/vite-pwa/nuxt/issues/53
export default {
pwa: {
registerWebManifestInRouteRules: true,
scope: '/',
base: '/',
manifest: {
name: process.env.SITE_NAME_FRONTEND,
useWebmanifestExtension: false,
},
injectRegister: 'auto',
registerType: 'autoUpdate',
workbox: {
globPatterns: ['**/*.{js,css,html,png,svg,ico}'],
runtimeCaching: [
{
urlPattern: '/',
handler: 'NetworkFirst',
},
],
navigateFallback: undefined,
},
},
}
App.vue confifguration:
<div>
<NuxtPwaManifest />
<NuxtLayout>
<NuxtLoadingIndicator :color="'#000'" />
<NuxtPage />
</NuxtLayout>
</div>
It helps another your discussion: https://github.com/vite-pwa/nuxt/issues/53
Thanks and kidn regards, Davide
Hi, I'm struggling because I cannot figure out how to solve these errors:
I installed:
@vite-pwa/nuxt": "^0.10.5"
I add it in modules:I configure it in a minimal way and add it in my nuxt.config.ts:
and after, as doc says I add the component in app.vue:
So I think I follow step by step the instructions but the errors still there. You can check here: https://zavaluce.it/
Any advice woul be appreciated!
Really thanks and kind regards,
Davide