-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
WorkboxError non-precached-url index.html #120
Comments
@jonian can you try removing |
The problem is that routes are not added to the sw precache, you need to add them manually, I'll push changes to my fork and make a PR to your repo. You can see this comment antfu-collective/vitesse#159 for an explanation. |
Well, the problem is on your Since you are using Just remove the You also need to add all red entries shown bellow to make it work offline, it is working, but some images missing: |
Thanks for the quick response and the help @userquin |
@jonian I will add some entry on docs when using |
Thank you again @userquin, that will be really helpful. |
@userquin there are no images missing, they are the fonts the app uses from workbox: {
globPatterns: [
'*/*.*',
'*.*'
]
} Without the With the |
@jonian read this entry to configure properly your external fonts: https://vite-plugin-pwa.netlify.app/workbox/generate-ws.html#cache-external-resources Basically you need to add crossorigin and then add runtimeCaching for fonts urls. I suggest you to add also |
@jonian I have included a warning on |
Sorry to pickup an old thread here, however this is causing some confusion for me. I'm using Vite to SSR a page, however the If I add the html file to the ignore glob, I get the |
@userquin I have got a similar problem, how can i exclude the html file. |
I use this config now - not sure if it's fully correct but seems to be working: {
strategies: 'generateSW',
workbox: {
// Only precache these files - html should be excluded
globPatterns: ['**/*.{js,css}'],
// Don't fallback on document based (e.g. `/some-page`) requests
// Even though this says `null` by default, I had to set this specifically to `null` to make it work
navigateFallback: null,
} This seems to remove the generated config containing the index.html, which is then just handled by the server. |
@Ehesp you're right, the default value when undefined is configured by the options module with |
I made a quick PR to update the type docs: GoogleChrome/workbox#3106 |
Thanks. I was having the same issue here, this config. helped out. |
Hi, thank you for this plugin.
I'm getting the error below when running the app with
vite preview
and in production. The app source code is available at https://github.com/jonian/awmonitor and the production link is https://awmonitor.netlify.app.The text was updated successfully, but these errors were encountered: