preload-webpack-plugin icon indicating copy to clipboard operation
preload-webpack-plugin copied to clipboard

Cannot read property 'tap' of undefined

Open Redirts opened this issue 5 years ago • 4 comments

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), :200:1) at Hook.CALL_DELEGATE [as _call] (C:\node_modules\tapable\lib\Hook.js:14:14) at Compiler.newCompilation (C:\node_modules\webpack\lib\Compiler.js:993:26) at C:\node_modules\webpack\lib\Compiler.js:1035:29 at Hook.eval [as callAsync] (eval at create (C:\node_modules\tapable\lib\HookCodeFactory.js:33:10), :20:1) at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:\node_modules\tapable\lib\Hook.js:18:14) at Compiler.compile (C:\node_modules\webpack\lib\Compiler.js:1030:28) at C:\node_modules\webpack\lib\Watching.js:112:19 at Hook.eval [as callAsync] (eval at create (C:\node_modules\tapable\lib\HookCodeFactory.js:33:10), :32:1)

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)/], }), ],

Redirts avatar Feb 08 '21 00:02 Redirts

  • include: 'allAssets' hasn't been supported in this fork yet
  • webpack 5 support is underway: https://github.com/vuejs/preload-webpack-plugin/pull/14

haoqunjiang avatar Feb 10 '21 14:02 haoqunjiang

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'.

mririgoyen avatar Feb 16 '21 04:02 mririgoyen

Same as @goyney – using 1.1.2 + include: 'initial' – same issue.

iMakedonsky avatar Mar 07 '21 14:03 iMakedonsky

Same issue in 2.0.0

Cannot read property 'tap' of undefined

carlzogh avatar Dec 09 '22 11:12 carlzogh