Main webpack output bundle no longer pre-cached in V5
See original GitHub issueLibrary Affected: workbox-precaching, V5 Alpha 2
Browser & Platform: webpack
Issue or Feature Request Description: My main output file from webpack is no longer being included in the precache manifest after upgrading from V4 to V5. Here are the js assets that webpack outputs to my filesystem:
1.index_bundle.js
2.index_bundle.js
editor.worker.js
index_bundle.js
typescript.worker.js
Here’s the cache manifest file that workbox v4 would output. Note that index_bundle.js is included.
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "c4bddb31ace86dbd7f567b40cb5a0bfd",
"url": "index.html"
},
{
"revision": "6180120d73972d5b0c2a",
"url": "js/1.index_bundle.js"
},
{
"revision": "96df8d6da3d4ae7f5051",
"url": "js/2.index_bundle.js"
},
{
"revision": "1fe07dc59a6c1a48c4fd173280d8ba88",
"url": "js/editor.worker.js"
},
{
"revision": "85e7395985be8377cdee",
"url": "js/index_bundle.js"
},
{
"revision": "b74c9f976a468d7407e2346e516585b8",
"url": "js/typescript.worker.js"
}
]);
Here’s the precache manifest that V5 outputs (inline in sw.js):
self.__WB_MANIFEST = [
{ revision: "c4bddb31ace86dbd7f567b40cb5a0bfd", url: "index.html" },
{ revision: "d4059a63ae8430589d9ddb5a4b1be0eb", url: "js/1.index_bundle.js" },
{ revision: "208f42a5bd2761181e6078e893d5dad7", url: "js/2.index_bundle.js" },
{ revision: "1fe07dc59a6c1a48c4fd173280d8ba88", url: "js/editor.worker.js" }
];
index.bundle.js is missing here (and also typescript.worker.js I just noticed). The only change on my end is upgrading workbox. Not sure what to do to further debug why this is the case any advice is appreciated.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Caching - webpack
This guide focuses on the configuration needed to ensure files produced by webpack compilation can remain cached unless their content has changed. Output...
Read more >Upgrade to Webpack 5 failing - node.js - Stack Overflow
0.0 no longer allows custom properties in configuration. Loaders should be updated to allow passing options via loader options in module.rules.
Read more >Migrate from Workbox v4 to v5 - Chrome Developers
A guide to migrating from Workbox v4 to v5. ... Node.js versions prior to v8 are no longer supported for workbox-webpack-plugin ...
Read more >A mostly complete guide to webpack 5 (2020)
Now run again npm run dev and you should see no more errors. ... dist └── main.js. This is your first webpack bundle,...
Read more >An Annotated webpack 4 Config for Frontend Web…
As web development becomes more complex, we need tooling to help us build modern websites. Here's a complete real-world production example ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the reproduction steps.
It might be hard to spot amongst all the other WARNING messages, but the following is logged and explains what’s going on:
As the message explains, you can configure
maximumFileSizeToCacheInBytes
to a value larger than the size of those assets if you want to precache them. (But be aware, of course, that precaching several megabytes unconditionally might not play nicely with devices using low-end connections. You know your user base better than I do, of course.)🤦♂️ Argh. Thanks and sorry for taking up your time with this. This is under development so haven’t gotten to code splitting things properly yet. It’s also an offline first desktop app so requirements are a bit more relaxed.