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:


目录
相关文章
from pymdownx import superfences No module named ‘pymdownx‘
from pymdownx import superfences No module named ‘pymdownx‘
106 0
target\surefire-reports for the individual test results
target\surefire-reports for the individual test results
787 0
ModuleNotFoundError: No module named ‘mmdet.version‘
ModuleNotFoundError: No module named ‘mmdet.version‘
1533 0
|
2月前
|
Java 数据库 开发者
8-3|org.logicalcobwebs.proxool.default - Shutting down 'default' pool immediately [Shutdown Hook]
8-3|org.logicalcobwebs.proxool.default - Shutting down 'default' pool immediately [Shutdown Hook]
Warning: To load an ES module, set “type“: “module“ in the package.json or use the .mjs extension.
Warning: To load an ES module, set “type“: “module“ in the package.json or use the .mjs extension.
|
5月前
|
Python
【已解决】ModuleNotFoundError: No module named ‘DBUtils‘,from DBUtils.PooledDB import PooledDB,
【已解决】ModuleNotFoundError: No module named ‘DBUtils‘,from DBUtils.PooledDB import PooledDB,
240 0
|
11月前
(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
|
Python
Could not import the lzma module
Could not import the lzma module
379 0
Error creating bean with name ‘org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0‘
Error creating bean with name ‘org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0‘
128 0
|
前端开发