Cannot read property 'tap' of undefined
Tried to replace old preload-webpack-plugin in my webpack 5 config with this fork and I'm getting this error:
compilation PreloadPlugin[webpack-cli] TypeError: Cannot read property 'tap' of undefined
at C:\node_modules@vue\preload-webpack-plugin\src\index.js:115:65
at Hook.eval [as call] (eval at create (C:\node_modules\tapable\lib\HookCodeFactory.js:19:10),
Webpack plugin config:
plugins: [ new DefinePlugin({ "process.env": "{}" }), new ProgressPlugin(), new HtmlWebPackPlugin({ template: "./src/index.html", filename: "./index.html", }), new PreloadWebpackPlugin({ rel: "preload", include: "allAssets", fileBlacklist: [/.(js|ttf|png|eot|jpe?g|css|svg)/], }), ],
-
include: 'allAssets'hasn't been supported in this fork yet - webpack 5 support is underway: https://github.com/vuejs/preload-webpack-plugin/pull/14
I'm also seeing this issue on the 1.1.2 version (using that because of Preact's use of the 3.x branch of HtmlWebpackPlugin. However, I'm not using include: 'allAssets'.
Same as @goyney – using 1.1.2 + include: 'initial' – same issue.
Same issue in 2.0.0
Cannot read property 'tap' of undefined