Solvedworkbox [v5.0.0-beta.1] Can't find self.__WB_MANIFEST in your SW source

Library Affected:

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.
18 Answers

✔️Accepted Answer

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 #2251.

Other Answers:

I have encountered the same error whilst using webpack-workbox-plugin with the InjectManifest function.
Adding literally just self.__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.

Related Issues:

workbox Precache manifest missing entries when recompiled via webpack --watch
A similar approach as per @devarthurribeiro but through the disable option: Library Affected: workbo...
workbox Link to TypeScript definitions for workbox-sw
@Manc First you don' have to add anything to your tsconfig.json file Library Affected: workbox-sw Br...
workbox [v5.0.0-beta.1] Can't find self.__WB_MANIFEST in your SW source
Your swSrc shows: By default you need to use self.__WB_MANIFEST: (Unless you set injectionPoint: '__...
workbox Recommended Approach for Refreshing Page on new SW
Well I don't think that this is an advanced recipe I mean If you want to use workbox to precache you...
react boilerplate WebpackDevServer breaks on complex nested routes
Add the publicPath to your output option in your webpack config: Was running into this for a few day...
react boilerplate Sagas are injected twice!?
This is my current approach of making sure sagas are injected only once For some reason the sagas ar...
react boilerplate server is permanently running on port :3000 - not able to kill the process
Go to chrome://serviceworker-internals and chrome://appcache-internals search for localhost:3000 and...
react boilerplate Accessing environment variables in client-side code and creating builds for multiple environments
Thanks but it's not exactly what I'm looking for I've actually tried that approach but it requires d...
react boilerplate cross-env: command not found
npm install cross-env will fix your problems! I wonder why that's not installed… ...
react boilerplate RFC: Prettier
Prettier is definitely the must I will be more than happy to help with that But probably let's discu...
react boilerplate Webpack Error when trying to pack CSS
Hello! Do you have in webpack config loaders for css files? I have to include statically a library (...
react boilerplate How to load local font files (otf, ttf, woff, etc)
I think the file loader is only looking for imports in js files (not within css files) ...
react boilerplate How to configure App level saga?
Here is my solution for a global saga I could probably inject my global reducer here too ...
react boilerplate Global Variables are ignored
I'm still having a problem with this Getting warnings for every global variable I use I tried adding...
react boilerplate Cannot build when redux-form is imported
Ok so you need to use this on the form component: import { Field reduxForm } from 'redux-form/immuta...
react boilerplate [Question] How to pass route parameters through to a saga ?
How about page reload/refresh? locationBeforeTransitions is null if I reload. Imagine a scenario whe...
react boilerplate How to run a saga for a container that does not use react-router ?
I've had some trouble while implementing @bobkocisko solution and @learntoswim solution mainly becau...
react boilerplate anyone using redux-form with this ?
redux-form 5 doesn't work with immutableJS state out of the box I am trying to integrate redux-form ...
react boilerplate Errors when 'Building the Webpack DLL....'
Have you tried adding the dependency to internals/config.js in the exclude array? ...
gun TypeScript
Hello everyone I've published @types/gun. Hi what is your opinion about TypeScript TypeScript got a ...
react boilerplate Issue with adding meterial-ui library
This is great sokra himself is wanting to remove it it must have issues Thanks for the link @GGAlanS...
react boilerplate Overriding Bootstrap
I got it working You want to extract bootstrap.css from compiled main.js into compiled main.css ...
offline plugin SWs & Webpack
(text may have a lot of type because I wasn't re-reading/reviewing it) I actually been thinking abou...
offline plugin How to exclude a specific path and all the paths underneath from being cached?
/admin and all the paths underneath are not part of my app so I want to avoid the SW from caching th...
react boilerplate [Module not found: Error:] "Can't resolve" a component exported through an index.js
If it works fine in dev but not in production can you please try removing the new webpack.optimize.D...
react boilerplate Problem with integrating Semantic UI
Two bugs here: The one reported by @kfrajtak i believe is related to the fs module now being integra...
stencil JSX.IntrinsicElements error with typescript and react
for people struggling with this I've gotten things working this way eslint will shout about using de...
WebFundamentals ERROR: Failed to resolve: com.github.GoogleChrome.custom-tabs-client:customtabs:d08e93fce3
Okay.. sorry for referencing any of the contributors.. nothing is more frustrating than a failed bui...
create react pwa DOMException: unsupported MIME type for service worker
That's expected and my apologies that this can be confusing In a development environment ...
react universally Cannot add React-toolbox components
In addition to the right loader setup Hello I've been stuck for a while on this issue! I cloned the ...
stencil Rollup: Missing Export component is not exported
I managed to fix my issue using the following configuration in stencil.config.js: Notice how commonj...
next pwa Error on build "TypeError: Cannot read property 'tapPromise' of undefined"
Hi there this is weird I was facing the same issue but I actually make it work by using webpack 5 by...
msw server.use() or server.resetHandlers do not appear to be working within/between tests
I have tried as above and it works Let me know if I'm wrong Describe the bug server.use() or server....
msw Failed to construct 'Response': The status provided (0) is outside the range [200, 599]
Based on the amazing job done by @timdeschryver and other participants of this thread I've added a p...
next offline A bad HTTP response code (404) was received when fetching the script.
Guys I have been dealing with the same error and the way to fix it was as @hanford recommended ../ b...
msw Error: Error: connect ECONNREFUSED
Hi @slim-hmidi your configuration seams right :) Could I ask you to replace with and check then your...
msw Unable to be used alongside superagent
Technical details The issue is caused by the RequestOptions object supertest creates Unlike regular ...
msw How to deal with requests made before msw has been activated?
This should be re-opened The promise returned by start can resolve before the service worker is actu...
msw Question: why I cannot see my request even cannot see it x-powered-by: msw
I understand the issue I didn't see before @timdeschryver has right you should do has he suggested o...