我根据此文档将我的 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
我能做些什么来解决这个问题?最佳答案
我知道这个答案有点晚了,但我最近遇到了同样的问题。我能够通过将我的 html-webpack-plugin 版本更新到 v5.3.2 来解决它(截至撰写本文时的最新版本)。我正在使用 Node/NPM,所以对于我的解决方案,我只是更改了 package.json 文件中的版本号,然后运行 npm install
关于javascript - 我将 webpack v4 升级到 v5,之后出现 "cannot add property"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68302157/