Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

200.html / 400.html - without file extension in service worker #10

Closed
szsolutions opened this issue Feb 3, 2023 · 3 comments
Closed

Comments

@szsolutions
Copy link

Hello

I am new to nuxt and vite-pwa, so it may well be that I have a configuration error.

 n.precacheAndRoute(
      [
....
        { url: '200', revision: 'f017175f2273a0084e9bc17de70d165d' },
        { url: '404', revision: 'f017175f2273a0084e9bc17de70d165d' },

the created serviceworker file shows a precache for the files 200.html and 404.html. But these are not found and the worker aborts. If I add the entries with the .html everything runs.

my nuxt.config.ts

pwa: {
    injectRegister: 'script',
    //registerType: 'autoUpdate',
    //registerWebManifestInRouteRules: true,
    workbox: {
      //navigateFallback: '/',
      globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
      clientsClaim: true,
      skipWaiting: true,
    },
    installPrompt: true,
    periodicSyncForUpdates: 20,
    client: {
      installPrompt: true,
      periodicSyncForUpdates: 20,
    },
    devOptions: {
      enabled: true,
      type: 'module',
    },
    manifest: {
....
}
}
@userquin
Copy link
Member

userquin commented Feb 3, 2023

How are you running the generate build? I'm running the playground using pnpm dev:generate && npx serve playground/dist:

imagen

@szsolutions
Copy link
Author

now it works... but i dont know why
thanks anyway and sorry!

@userquin
Copy link
Member

userquin commented Feb 3, 2023

@webfondue added run scripts for playground to the root package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants