小编Abh*_*thi的帖子

我将 webpack v4 升级到 v5,之后出现“无法添加属性”错误

我按照此文档将我的 webpack v4 升级到 v5 https://webpack.js.org/migrate/5,之后我收到此错误。

TypeError: Cannot add property htmlWebpackPluginAlterChunks, object is not extensible
    at /home/ec2-user/abhisar/insights-master/frontend/node_modules/html-webpack-plugin/index.js:59:56
    at Hook.eval [as call] (eval at create (/home/ec2-user/abhisar/insights-master/frontend/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:100:1)
    at Hook.CALL_DELEGATE [as _call] (/home/ec2-user/abhisar/insights-master/frontend/node_modules/webpack/node_modules/tapable/lib/Hook.js:14:14)
    at Compiler.newCompilation (/home/ec2-user/abhisar/insights-master/frontend/node_modules/webpack/lib/Compil
Run Code Online (Sandbox Code Playgroud)

我可以做什么来解决这个问题?

我收到的错误与 html-webpack-plugin 有关

javascript webpack html-webpack-plugin webpack-5

13
推荐指数
1
解决办法
8434
查看次数