[v5.0.0-beta.1] Can't find self.__WB_MANIFEST in your SW source
See original GitHub issueLibrary Affected: workbox-webpack-plugin
Browser & Platform: all browsers
Issue or Feature Request Description: The issue has been introduced in v5.0.0-beta.1
During compilation:
ERROR in Can't find self.__WB_MANIFEST in your SW source.
if I set the injectionPoint
explicitly with the default value (injectionPoint: '__WB_MANIFEST'
), the error is different
ERROR in Can't find data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvY29yZS1qcy9pbnRlcm5hbHMvYS1mdW5jdGlvbi5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2ludGVybmFscy9hLWZ1bmN0aW9uLmpzPzFjMGIiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKHR5cGVvZiBpdCAhPSAnZnVuY3Rpb24nKSB7XG4gICAgdGhyb3cgVHlwZUVycm9yKFN0cmluZyhpdCkgKyAnIGlzIG5vdCBhIGZ1bmN0aW9uJyk7XG4gIH0gcmV0dXJuIGl0O1xufTtcbiJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQURBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=/n/# in assets.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:17 (7 by maintainers)
Top Results From Across the Web
No matching service worker detected. You may need to reload ...
You may need to reload the page, or check that the scope of the service worker for the current ... ERROR in Can't...
Read more >Add a web app manifest
The web app manifest is a simple JSON file that tells the browser about your web application and how it should behave when...
Read more >Web app manifests - MDN Web Docs - Mozilla
Chrome Edge
display Full support. Chrome39. Toggle history Full support. Edge7...
display_override. Experimental Full support. Chrome89. Toggle history Full support. Edge8...
icons Full support. Chrome39. Toggle...
Read more >Web Application Manifest - W3C
This specification defines a JSON-based file format that provides developers with a centralized place to put metadata associated with a web ...
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
Your
swSrc
shows:By default, you need to use
self.__WB_MANIFEST
:(Unless you set
injectionPoint: '__WB_MANIFEST'
, like you said.)Apologies if this specific requirement caught you out while testing the beta releases, especially since we don’t have the documentation in place yet. That’s the default
injectionPoint
that we’re going with in v5 across all the build tools.And again, the second error you encountered, once you got the
injectionPoint
configuration resolved, should be addressed by https://github.com/GoogleChrome/workbox/pull/2251.I have encountered the same error whilst using webpack-workbox-plugin with the
InjectManifest
function. Adding literally justself.__WB_MANIFEST
to the bottom of my Service Worker file seems to have fixed it. I guess the plugin code expects to find this variable in the file and doesn’t like it when it isn’t there. It seems odd that I need to add this (seemingly useless, since I’m not interested in precaching) piece of boilerplate code into my service worker. Is the plugin really not able to do this? It also isn’t in the documentation anywhere that I’d expect it to be. e.g. https://developers.google.com/web/tools/workbox/guides/precache-files/webpack