question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No module factory available for dependency type: ModuleHotAcceptDependency

See original GitHub issue

Bug report

What is the current behavior? image

If the current behavior is a bug, please provide the steps to reproduce. package.json(has deleted some extra npm package) { "name": "h5_friends_editor", "version": "1.0.0", "description": "圈子详情页面", "repository": {}, "license": "MIT", "private": true, "dependencies": { "@babel/polyfill": "^7.8.7", "babel-polyfill": "^6.26.0", "babel-runtime": "~6.26.0", "classnames": "^2.2.6", "history": "~4.7.2", "immutability-helper": "~2.9.0", "linaria": "1.3.1", "lodash.get": "^4.4.2", "pubsub-js": "^1.8.0", "query-string": "~5.1.1", "rc-util": "^4.13.0", "react": "^16.13.1", "react-dom": "^16.13.1", "react-redux": "^7.2.0", "react-router-dom": "~4.3.1", "react-string-replace": "^0.4.4", "redux": "^4.0.5", "redux-actions": "^2.6.5", "redux-thunk": "^2.3.0", "socket.io-client": "^2.3.0", "styled-components": "3.4.10", "superagent": "~3.8.2" }, "devDependencies": { "@babel/cli": "^7.8.4", "@babel/core": "^7.9.6", "@babel/plugin-proposal-class-properties": "^7.8.3", "@babel/plugin-proposal-decorators": "^7.8.3", "@babel/plugin-proposal-export-default-from": "^7.8.3", "@babel/plugin-proposal-json-strings": "^7.0.0", "@babel/plugin-syntax-dynamic-import": "^7.0.0", "@babel/plugin-syntax-import-meta": "^7.0.0", "@babel/plugin-transform-runtime": "^7.9.6", "@babel/preset-env": "^7.9.6", "@babel/preset-react": "^7.9.4", "@types/classnames": "^2.2.9", "@types/friendly-errors-webpack-plugin": "^0.1.2", "@types/lodash.get": "^4.4.6", "@types/mini-css-extract-plugin": "^0.9.1", "@types/node": "^14.0.1", "@types/pubsub-js": "^1.5.18", "@types/react": "^16.9.17", "@types/react-dom": "^16.9.4", "@types/react-redux": "^7.1.8", "@types/speed-measure-webpack-plugin": "^1.3.0", "@types/webpack": "^4.41.13", "@types/webpack-dev-server": "^3.10.1", "@types/webpack-merge": "^4.1.5", "autoprefixer": "^7.1.3", "babel-eslint": "^8.0.2", "babel-loader": "^8.1.0", "babel-minify-webpack-plugin": "^0.2.0", "babel-plugin-import": "^1.4.0", "babel-plugin-react-transform": "^2.0.2", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.6.1", "babel-preset-minify": "^0.2.0", "babel-preset-react": "^6.24.1", "bundle-loader": "~0.5.6", "clean-webpack-plugin": "^3.0.0", "core-js": "~2.6.0", "css-loader": "^3.5.3", "eslint-config-ali": "^2.0.2", "eslint-plugin-compat": "^2.1.0", "eslint-plugin-es5": "^1.3.1", "file-loader": "~1.1.5", "friendly-errors-webpack-plugin": "^1.7.0", "html-loader": "^0.5.1", "html-webpack-plugin": "^4.3.0", "json-loader": "^0.5.7", "less-loader": "^6.1.0", "mini-css-extract-plugin": "^0.9.0", "postcss-loader": "^2.0.6", "postcss-pxtorem": "^4.0.1", "pre-commit": "^1.2.2", "react-transform-hmr": "^1.0.4", "speed-measure-webpack-plugin": "^1.3.3", "style-loader": "^0.18.2", "svg-sprite-loader": "^3.2.5", "ts-loader": "^4.5.0", "ts-node": "^8.10.1", "typescript": "^3.7.4", "url-loader": "^4.1.0", "webpack": "^4.43.0", "webpack-build-notifier": "^2.0.0", "webpack-bundle-analyzer": "^2.9.1", "webpack-cli": "^3.3.11", "webpack-dev-server": "^3.11.0", "webpack-hot-middleware": "^2.25.0", "webpack-merge": "^4.2.2" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "webpack-dev-server --config config/webpack.config.dev.ts --progress --color --host 0.0.0.0", "build": "node build.js", "analyzer": "node build.js --analyzer", "prestart": "npm run update-i18n", "prebuild": "npm run update-i18n", "update-i18n": "update-i18n ./translationKeys.js ./i18nResource -n circle -b \"id_ID|ms_MY|ne_NP|th_TH\"", "windows": "set NODE_ENV=development&&ding socket -p 8080", "precommit-msg": "echo '正在执行eslint验证...' && exit 0", "eslint": "sh eslint.sh", "eslint-fix": "./node_modules/eslint/bin/eslint.js --fix ./src/", "eslint-build": "./node_modules/eslint/bin/eslint.js --no-eslintrc -c ./.eslintForBuildrc ./build/" }, "pre-commit": [ "precommit-msg" ], "browserslist": [ "iOS >= 7", "Android >= 4", "ChromeAndroid >= 40", "UCAndroid >= 11", "Chrome >= 40" ] } `webpack.config.base.ts

import path from ‘path’; import webpack from ‘webpack’;

const config: webpack.Configuration = { entry: { vendor: [ “react”, “react-dom”, “react-router”, “react-router-dom” ], }, output: { path: path.resolve(__dirname, ‘circle’), filename: ‘[name].js’, publicPath: ‘/’ }, module: { rules: [ { test: /.tsx?$/, use: [ ‘babel-loader’, ‘ts-loader’ ], include: [ path.resolve(__dirname, ‘…/src’), path.resolve(__dirname, “…/node_modules/@ali/ding-circle-pro”), path.resolve(__dirname, ‘…/i18nResource’) ] }, { test: /.jsx?$/, use: ‘babel-loader’, include: [ path.resolve(__dirname, ‘…/src’), path.resolve(__dirname, “…/node_modules/@ali/ding-circle-pro”), path.resolve(__dirname, ‘…/i18nResource’) ] }, { test: /.css$/, use: [ ‘style-loader’, ‘css-loader’ ], include: [ path.resolve(__dirname, ‘…/src’), path.resolve(__dirname, “…/node_modules/@ali/ding-circle-pro”), ] }, { test: /.less$/, use: [ ‘style-loader’, ‘css-loader’, { loader: ‘less-loader’, options: { lessOptions: { javascriptEnabled: true }, sourceMap: true } } ], include: [ path.resolve(__dirname, “…/src”), path.resolve(__dirname, “…/node_modules/antd”), path.resolve(__dirname, “…/node_modules/@ali/ding-circle-pro”), path.resolve(__dirname, “…/node_modules/@ali/swift-ui-result”), path.resolve(__dirname, “…/node_modules/@ali/swift-ui-follow-circle”), path.resolve(__dirname, “…/node_modules/@ali/swift-ui-work-score-tag”), path.resolve(__dirname, “…/node_modules/@ali/swift-ui-ding-face”), path.resolve(__dirname, “…/node_modules/@ali/swift-ui-complex-text”) ] }, { test: /.html$/, use: “html-loader” }, // json-loader isn’t necessary anymore in webpack version greater than or equal to 2.0 // { // test: /.json$/, // use: “json-loader”, // exclude: /node_modules/, // }, { test: /.(png|gif|jpeg|jpg)$/, use: “url-loader?limit=100000” }, { test: /.(woff|woff2|ttf|eot)(?.+)?$/, use: “url-loader” }, { test: /.(svg)$/i, loader: “svg-sprite-loader”, options: { runtimeCompat: true }, } ] }, resolve: { modules: [‘node_modules’, path.resolve(__dirname, “src”)], extensions: [“.web.ts”, “.web.jsx”, “.web.js”, ‘.tsx’, ‘.ts’,“.js”, “.jsx”, “.react.js”], alias: { “@components”: path.resolve(__dirname, ‘…/src/components’), } }, optimization: {}, }

export default config;

// webpack.config.dev.ts import path from ‘path’; import webpack from ‘webpack’; import HtmlWebpackPlugin from ‘html-webpack-plugin’; import MiniCssExtractPlugin from ‘mini-css-extract-plugin’; import WebpackBuildNotifierPlugin from ‘webpack-build-notifier’; import webpackBaseConfig from ‘./webpack.config.base’; import WebpackMerge from ‘webpack-merge’; import SpeedMeasurePlugin from ‘speed-measure-webpack-plugin’; import FriendlyErrorsWebpackPlugin from ‘friendly-errors-webpack-plugin’; import { CleanWebpackPlugin } from ‘clean-webpack-plugin’;

const smp = new SpeedMeasurePlugin();

const config: webpack.Configuration = WebpackMerge(webpackBaseConfig, { mode: ‘development’, entry: { postDetail: [‘webpack-hot-middleware/client’,‘./src/entry/postDetail’] }, devtool: ‘source-map’, devServer: { inline: true, open: true, // 服务器启动成功后,将自动打开浏览器 overlay: {//当出现编译器错误或警告时,就在网页上显示一层黑色的背景层和错误信息 errors: true }, hot: true, }, plugins: [ new FriendlyErrorsWebpackPlugin({ // compilationSuccessInfo: { // messages: [‘You application is running here http://localhost:8002’], // notes: [‘Some additionnal notes to be displayed unpon successful compilation’] // }, clearConsole: true, additionalFormatters: [], additionalTransformers: [] }), new CleanWebpackPlugin(), new HtmlWebpackPlugin({ title: “圈子页面title”, filename: “postDetail.html”, mete: { viewport: ‘viewport-fit=cover,width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1’ } }), new webpack.NamedModulesPlugin(), new webpack.HotModuleReplacementPlugin(), new WebpackBuildNotifierPlugin({ title: ‘H5_friend_editor Project Webpack Build’, suppressSuccess: false, suppressCompileStart: false, suppressWarning: false, activateTerminalOnError: true }) ] });

export default smp.wrap(config); `

What is the expected behavior? hot replace

Other relevant information: webpack version: 4.41.13 Node.js version: 10.15.0 Operating System: macOS High Sierra 10.13.6 Additional tools:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
dadaa1commented, Jun 5, 2020

I have this problem, too Maybe it’s the speed-measure-webpack-plugin,You can remove it

这样就好了

1reaction
toFrankiecommented, May 26, 2021

I have this problem, too Maybe it’s the speed-measure-webpack-plugin,You can remove it

这样就好了

It is possible to remove speed-measure-webpack-plugin, but no solution has been found yet. Related isuees are here: issues#117

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: No module factory available for dependency type ...
I'm using node version 6.9.2 in my local. Error: 18% building modules 70/104 modules 34 active ..
Read more >
No module factory available for dependency type
I've got this on latest release when trying to rebuild #117 · No module factory available for dependency type: ModuleHotAcceptDependency #10897 ...
Read more >
webpack/webpack - Gitter
Error : No module factory available for dependency type: CssDependency. Geert Pasteels. @Enome. Hello, I just ran into an issue that took me...
Read more >
Error: No module factory available for dependency ... - 博客园
40% building 68/69 modules 1 active ...im\Web.UI.Claim\wwwroot\src\styles.scss× 「wdm」: Error: No module factory available for dependency ...
Read more >
No module factory available for dependency type - 简书
No module factory available for dependency type : ModuleHotAcceptDependency ... 今天在优化Webpack 配置时,使用到 speed-measure-webpack-plugin 来 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found