stephencookdev / speed-measure-webpack-plugin

⏱ See how fast (or not) your plugins and loaders are, so you can optimise your builds
MIT License
2.42k stars 80 forks source link

I've got this on latest release when trying to rebuild #117

Open sibelius opened 4 years ago

sibelius commented 4 years ago
Error: No module factory available for dependency type: ModuleHotAcceptDependency
at addDependency (/app/node_modules/webpack/lib/Compilation.js:800:12)
at iterationOfArrayCallback (/app/node_modules/webpack/lib/Compilation.js:208:3)
at addDependenciesBlock (/app/node_modules/webpack/lib/Compilation.js:816:5)
at Compilation.processModuleDependencies (/app/node_modules/webpack/lib/Compilation.js:827:4)
at afterBuild (/app/node_modules/webpack/lib/Compilation.js:954:15)
at processTicksAndRejections (internal/process/task_queues.js:79:11)
stephencookdev commented 4 years ago

Hey @sibelius — thanks for flagging. Can you give me some repro steps for this? I haven't seen this error

sibelius commented 4 years ago

not sure if it is related to https://github.com/shellscape/webpack-plugin-serve

xcv58 commented 4 years ago

I had the same error.

This commit removes the speed-measure-webpack-plugin from development and so that I can upgrade webpack: https://github.com/xcv58/Tab-Manager-v2/commit/75727bc82f84f0e3c41bf17a137021d9362b5013

And this line causes the bug: https://github.com/webpack/webpack/blob/2346f6b245a92f317535018129260d7c015734c9/lib/HotModuleReplacementPlugin.js#L191-L193

I guess the smp.wrap generate the WrappedPlugin for the plugin in webpack config. The generated plugin cause the condition (compilation.compiler !== compiler) be true.

xcv58 commented 4 years ago

Here is a cleaner reproduce PR: https://github.com/xcv58/react-starter-boilerplate-hmr/pull/1/files

IanVS commented 4 years ago

I noticed this error when adding SMP to a storybook wepback config, if that's helpful at all.

toFrankie commented 3 years ago

I also have this problem, how can I solve it?

jlmitch commented 3 years ago

Been banging my head against a wall on this issue for the last 3 days now. Any movement here?

ecnatsiDehTog commented 2 years ago

My project builds fine without this plugin, but when I use it as the document shows, it has the error that all the less or file has build fail like this: ERROR in ./src/stylesheets/element.css No template for dependency: ModuleHotAcceptDependency @ ./src/pages/home/container/detailContainer.js 13:0-42 @ ./src/pages/home/routes.js 19:0-58 222:13-28 @ ./src/pages/home/index.tsx 16:0-43 113:14-29 its seems this pulgin conflicts with less loader or css loader?? `

edelauna commented 2 years ago

Could remove the HotModuleReplacementPlugin as plugin, and instead pass --hot when calling webpack serve