webpack-contrib/image-minimizer-webpack-plugin

FATAL Cannot read property 'tapPromise' of undefined

xueeryang opened this issue · 1 comments

my project is nuxt, and the plugin version is 2.2.0, he will report a error:

` FATAL Cannot read property 'tapPromise' of undefined 10:09:04

at node_modules\image-minimizer-webpack-plugin\dist\index.js:304:39
at SyncHook.eval [as call] (eval at create (node_modules\tapable\lib\HookCodeFactory.js:19:10), :11:1)
at SyncHook.lazyCompileHook (node_modules\tapable\lib\Hook.js:154:20)
at Compiler.newCompilation (node_modules\webpack\lib\Compiler.js:631:26)
at node_modules\webpack\lib\Compiler.js:667:29
at AsyncSeriesHook.eval [as callAsync] (eval at create (node_modules\tapable\lib\HookCodeFactory.js:33:10), :6:1)
at AsyncSeriesHook.lazyCompileHook (node_modules\tapable\lib\Hook.js:154:20)
at Compiler.compile (node_modules\webpack\lib\Compiler.js:662:28)
at node_modules\webpack\lib\Compiler.js:321:11
at Compiler.readRecords (node_modules\webpack\lib\Compiler.js:529:11)
at node_modules\webpack\lib\Compiler.js:318:10
at AsyncSeriesHook.eval [as callAsync] (eval at create (node_modules\tapable\lib\HookCodeFactory.js:33:10), :6:1)
at AsyncSeriesHook.lazyCompileHook (node_modules\tapable\lib\Hook.js:154:20)
at node_modules\webpack\lib\Compiler.js:315:19
at AsyncSeriesHook.eval [as callAsync] (eval at create (node_modules\tapable\lib\HookCodeFactory.js:33:10), :15:1)
at AsyncSeriesHook.lazyCompileHook (node_modules\tapable\lib\Hook.js:154:20)`

How can I use it normally? thanks for help

You need webpack v5 to use this plugin, but you still on webpack v4, run npm ls webpack, please ask to nuxt team update webpack, sorry we can't fix it here