Skip to content

Commit 6aef3a3

Browse files
authored
feat: throw specified error to indicate undefined factory case in HMR (#11584)
1 parent 5cf4f03 commit 6aef3a3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • crates/rspack_plugin_javascript/src/plugin

crates/rspack_plugin_javascript/src/plugin/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ impl JsPlugin {
177177
__webpack_require__.i.forEach(function(handler) { handler(execOptions); });
178178
module = execOptions.module;
179179
if (!execOptions.factory) {
180-
console.error("undefined factory", moduleId)
180+
console.error("undefined factory", moduleId);
181+
throw Error("RuntimeError: factory is undefined (" + moduleId + ")");
181182
}
182183
execOptions.factory.call(module.exports, module, module.exports, execOptions.require);
183184
"#}.into()

0 commit comments

Comments
 (0)