No module factory available for dependency type: ModuleHotAcceptDependency
今天在优化 Webpack 配置时,使用到 speed-measure-webpack-plugin
来测算 Webpack 各项打包速度。
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin') const smp = new SpeedMeasurePlugin() const webpackConfig = { // ... } module.exports = smp.wrap(webpackConfig)
在初次启动项目的时候,可以成功编译。可就在热更新的时候,就报了以下错误:
ℹ 「wdm」: Compiling...
✖ 「wdm」: Error: No module factory available for dependency type: ModuleHotAcceptDependency
at addDependency (/Users/frankie/Desktop/Web/company-git/pro234/react-demo/node_modules/webpack/lib/Compilation.js:800:12)
at iterationOfArrayCallback (/Users/frankie/Desktop/Web/company-git/pro234/react-demo/node_modules/webpack/lib/Compilation.js:208:3)
at addDependenciesBlock (/Users/frankie/Desktop/Web/company-git/pro234/react-demo/node_modules/webpack/lib/Compilation.js:816:5)
at Compilation.processModuleDependencies (/Users/frankie/Desktop/Web/company-git/pro234/react-demo/node_modules/webpack/lib/Compilation.js:827:4)
at afterBuild (/Users/frankie/Desktop/Web/company-git/pro234/react-demo/node_modules/webpack/lib/Compilation.js:954:15)
at processTicksAndRejections (internal/process/task_queues.js:75:11)
/Users/frankie/Desktop/Web/company-git/pro234/react-demo/node_modules/neo-async/async.js:16
throw new Error('Callback was already called.');
^
似乎是使用了
speed-measure-webpack-plugin
导致的,移除即可。
但如果同时该插件如何解决报错,暂时没找到解决方案,若后续有解决方案会回来更新的。
相关 issues:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论