No module factory available for dependency type: ModuleHotAcceptDependency

简介: 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:


目录
相关文章
ModuleNotFoundError: No module named ‘mmdet.version‘
ModuleNotFoundError: No module named ‘mmdet.version‘
1188 0
|
5月前
(node)Warning: Accessing non-existent property ‘xxx‘ of module exports inside circular depen
(node)Warning: Accessing non-existent property ‘xxx‘ of module exports inside circular depen
|
5月前
【Error】This dependency was not found: * core-js/modules/es.error.cause.js in ./node_modules/@babel
【Error】This dependency was not found: * core-js/modules/es.error.cause.js in ./node_modules/@babel
|
5月前
|
JavaScript
export default和module.exports
export default和module.exports
24 0
|
11月前
|
前端开发
Module理解及使用
Module理解及使用
81 0
|
Python
Could not import the lzma module
Could not import the lzma module
280 0
|
机器人
DefaultRobotHWSim::initSim函数详解
DefaultRobotHWSim::initSim函数详解
DefaultRobotHWSim::initSim函数详解
|
机器学习/深度学习 计算机视觉
成功解决This module was deprecated in version 0.18 in favor of the model_selection module into which all
成功解决This module was deprecated in version 0.18 in favor of the model_selection module into which all
Caused by: 元素类型为 "package" 的内容必须匹配 "(result-types?,interceptors?,default-interceptor-ref?,default-action-ref?,default-class-ref?,global-results?,globa
在Struts-2.3的配置文件struts.xml中,Caused by: 元素类型为 "package" 的内容必须匹配 "(result-types?,interceptors?,default-interceptor-ref?,default-action-ref?,default-class-ref?,global-results?,global-exception-mappings?,action*)"。
1283 0