WorkboxError non-precached-url index.html

See original GitHub issue

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.

WorkboxError.js:28 Uncaught (in promise) non-precached-url: non-precached-url :: [{"url":"index.html"}]
    at x.createHandlerBoundToURL (http://localhost:5000/workbox-a59a8da5.js:1:12967)
    at Object.createHandlerBoundToURL (http://localhost:5000/workbox-a59a8da5.js:1:14597)
    at http://localhost:5000/sw.js:1:10085
    at http://localhost:5000/sw.js:1:695
s @ WorkboxError.js:28
createHandlerBoundToURL @ PrecacheController.js:276
(anonymous) @ createHandlerBoundToURL.js:29
(anonymous) @ sw.js:486
(anonymous) @ sw.js:1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
userquincommented, Aug 21, 2021

Well, the problem is on your workbox.globPatterns entry: you need to include all, it is exclusive, that is, if you include this entry, you MUST add all your patterns, not only font assets: in your case, you are not including js and css assets and index.html page.

Since you are using vite, all entries under assets directory will be included, you don’t need to add them again.

Just remove the workbox entry from your configuration:

imagen

imagen

You also need to add all red entries shown bellow to make it work offline, it is working, but some images missing:

imagen

1reaction
Ehespcommented, Aug 2, 2022

I made a quick PR to update the type docs: https://github.com/GoogleChrome/workbox/pull/3106

Read more comments on GitHub >

github_iconTop Results From Across the Web

WorkboxError non-precached-url index.html #120 - GitHub
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/ ......
Read more >
Correct way to precache the root url ("/") - Stack Overflow
If I use webpack-plugin-workbox to generate the precacheManifest, it doesn't include an entry for "/". "/index.html" is included of course. Now ...
Read more >
Workbox - Chrome Developers
Introducing Workbox, a set of modules that simplify common service worker routing and ... Learn how to precache assets in a service worker...
Read more >
workbox changelog
workbox -precaching will default to confirming that all Response s cached during installation have a non-error (less than 400 ) HTTP status code....
Read more >
Static assets handling | Guide - Vite PWA - Netlify
If you're using PWA Manifest icons from any asset folder, but you are not ... error from your service worker: WorkboxError non-precached-url index.html....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found