我在编译过程中遇到一个错误。看起来对webpack的ProgressPlugin不太满意:
/node_modules/webpack/lib/ProgressPlugin.js:205
compilation.hooks.addEntry.tap("ProgressPlugin", entryAdd);
TypeError: Cannot read property 'tap' of undefined我知道最近对webpack 4的插件进行了一些更改。似乎编译钩子- https://webpack.js.org/api/compilation-hooks/的文档中没有addEntry, failedEntry, succeedEntry -我是不是遗漏了什么?
我的package.json副手:
"amazon-cognito-identity-js": "^2.0.30",
"array-move": "^1.0.0",
"aws-sdk": "^2.352.0",
"babel-loader": "^8.0.4",
"babel-plugin-styled-components": "^1.8.0",
"fuse.js": "^3.3.0",
"grid-styled": "^5.0.2",
"json-cycle": "^1.3.0",
"lodash": "^4.17.11",
"next": "^7.0.2",
"next-routes": "^1.4.2",
"node-fetch": "^2.2.1",
"path-match": "1.2.4",
"rc-time-picker": "^3.4.0",
"react": "^16.6.1",
"react-autocomplete": "^1.8.1",
"react-copy-to-clipboard": "^5.0.1",
"react-day-picker": "^7.2.4",
"react-dom": "^16.6.1",
"react-modal": "^3.6.1",
"react-places-autocomplete": "^6.1.3",
"react-scripts": "^1.1.5",
"react-spinners": "^0.4.7",
"react-stripe-checkout": "^2.6.3",
"react-stripe-elements": "^2.0.1",
"refunk": "^3.0.1",
"styled-system-html": "^2.0.2",
"webpack": "^4.25.1",
"webpack-dev-server": "^3.1.10"发布于 2018-12-08 06:48:13
你有两个不同版本的webpack,你安装的那个会导致它崩溃。
不要自己安装webpack (从package.json上删除它),它已经和next.js一起安装了
发布于 2020-10-13 17:45:14
在我的例子中,错误是我在resolve.plugins下放了一个插件,而不是直接放在webpack配置中的plugins中。解决方案来自:https://github.com/webpack/webpack/issues/8548#issuecomment-449829774
发布于 2021-05-20 23:06:39
这是因为不同的webpack。尝试运行此命令。
npm install --save-dev webpack@4.44.0https://stackoverflow.com/questions/53227877
复制相似问题