Workbox: [InjectManifest]: Getting error "TypeError: Cannot read property 'readFile' of null"

Created on 6 Nov 2018  路  4Comments  路  Source: GoogleChrome/workbox

I am getting following error when I am using "workboxPlugin.InjectManifest" in my webpack config.

WebPack Config:
{ new WorkboxPlugin.InjectManifest({ swSrc: paths.rap('src/sw.js'), swDest: 'static/js/sw.js' }) }

When I run build, I get following error:
image

Needs More Info workbox-webpack-plugin

All 4 comments

What version of webpack, and what version of workbox-webpack-plugin are you using?

I'm going to close this issue given the lack of additional info, but if you could provide the version that you're using, we can reopen and investigate further.

"webpack": "^1.13.2",
"workbox-webpack-plugin": "^3.6.3",
have same error.

[email protected] requires a peer of webpack@^2.0.0 || ^3.0.0 || ^4.0.0 but none is installed

@TuffyLiu, webpack v1 isn't supported by workbox-webpack-plugin. Please update to at least webpack v2 if you'd like to use Workbox along with webpack.

Was this page helpful?
0 / 5 - 0 ratings