html-webpack-plugin: TypeError: Cannot read property 'tapAsync' of undefined
error log points to a different library of “html-webpack-preconnect-plugin” but the error only happens when I update “html-webpack-plugin” from 3.2.0 to 4.0.3
TypeError: Cannot read property 'tapAsync' of undefined
at /Users/mypath/node_modules/html-webpack-preconnect-plugin/index.js:37:57
at SyncHook.eval [as call] (eval at create (/Users/mypath/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:13:1)
at SyncHook.lazyCompileHook (/Users/mypath/node_modules/tapable/lib/Hook.js:154:20)
at Compiler.newCompilation (/Users/mypath/node_modules/webpack/lib/Compiler.js:631:26)
at /Users/mypath/node_modules/webpack/lib/Compiler.js:667:29
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/mypath/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:4:1)
at AsyncSeriesHook.lazyCompileHook (/Users/mypath/node_modules/tapable/lib/Hook.js:154:20)
at Compiler.compile (/Users/mypath/node_modules/webpack/lib/Compiler.js:662:28)
at /Users/mypath/node_modules/webpack/lib/Watching.js:77:18
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/mypath/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:13:1)
at AsyncSeriesHook.lazyCompileHook (/Users/mypath/node_modules/tapable/lib/Hook.js:154:20)
at Watching._go (/Users/mypath/node_modules/webpack/lib/Watching.js:41:32)
at /Users/mypath/node_modules/webpack/lib/Watching.js:33:9
at Compiler.readRecords (/Users/mypath/node_modules/webpack/lib/Compiler.js:529:11)
at new Watching (/Users/mypath/node_modules/webpack/lib/Watching.js:30:17)
at Compiler.watch (/Users/mypath/node_modules/webpack/lib/Compiler.js:244:10)
at /Users/mypath/node_modules/webpack/lib/MultiCompiler.js:210:30
at /Users/mypath/node_modules/webpack/lib/MultiCompiler.js:185:6
at arrayEachIndex (/Users/mypath/node_modules/neo-async/async.js:2548:9)
at Object.map (/Users/mypath/node_modules/neo-async/async.js:2900:9)
at runCompilers (/Users/mypath/node_modules/webpack/lib/MultiCompiler.js:182:13)
at MultiCompiler.runWithDependencies (/Users/mypath/node_modules/webpack/lib/MultiCompiler.js:194:3)
at MultiCompiler.watch (/Users/mypath/node_modules/webpack/lib/MultiCompiler.js:205:9)
at processOptions (/Users/mypath/node_modules/webpack-cli/bin/cli.js:350:14)
at /Users/mypath/node_modules/webpack-cli/bin/cli.js:364:3
at Object.parse (/Users/mypath/node_modules/webpack-cli/node_modules/yargs/yargs.js:567:18)
at /Users/mypath/node_modules/webpack-cli/bin/cli.js:49:8
at Object.<anonymous> (/Users/mypath/node_modules/webpack-cli/bin/cli.js:366:3)```
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 19
- Comments: 15 (4 by maintainers)
Receiving this error using the react redux simple starter project deploying to github pages. I have an extremely simplified
package.jsoncontents but even then I’m not sure which other dependency is causing the compatibility issue because this is the only webpack plugin that I’ve installed so far and I’m still learning a lot about webpack.error output:
package.jsoncontents:webpack.config.jscontents:I’m not sure which dependency was causing the issue but I did manage to fix it by downgrading
"html-webpack-plugin": "^4.3.0",to"html-webpack-plugin": "3.2.0",Hopefully this helps someone else via google who’s also trying to learn webpack.
This error means your plugin is not compatible with
html-webpack-plugin4.xThe error tells you also which plugin is incompatible:
TypeError: Cannot read property ‘tapAsync’ of undefined
at /Users/mypath/node_modules/html-webpack-preconnect-plugin/index.js:37:57
So in this case html-webpack-preconnect-plugin has to upgrade to the new hooks:
@jantimon The problem is that there is already a PR - since the 11th of May…
@jantimon seems that you’re right. Inline-source-map plugin was the issue on my side. I found the solution over there:
@gabor-ottlik-epam
TypeError: Cannot read property 'tapAsync' of undefinedis thrown whenever a webpack event is used which does not exist… - so I am not sure if your problem is related at allFrustrating not to include the original link: https://github.com/DustinJackson/html-webpack-inline-source-plugin/issues/75