-
-
Notifications
You must be signed in to change notification settings - Fork 749
fix: panic when factorize failed in module executor #10136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses the panic issue during module factorization by handling diagnostics in the module executor.
- Prevents panic by checking for diagnostics and returning early from the execute task.
- Adds tests in rspack-test-tools to verify that module imports no longer panic.
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/rspack-test-tools/tests/diagnosticsCases/factorize/import-module/rspack.config.js | New test configuration to support the import-module test case |
packages/rspack-test-tools/tests/diagnosticsCases/factorize/import-module/render.js | Minimal export to support test execution |
packages/rspack-test-tools/tests/diagnosticsCases/factorize/import-module/index.js | Test case ensuring that module import does not panic |
packages/rspack-test-tools/tests/diagnosticsCases/factorize/import-module/import-module-example-loader.js | Loader that passes through content |
packages/rspack-test-tools/tests/diagnosticsCases/factorize/import-module/example-loader.js | Loader that attempts to import a non-existent module and handles the resulting error |
crates/rspack_core/src/compiler/module_executor/execute.rs | Updated executor to report diagnostics without panicking |
Files not reviewed (1)
- packages/rspack-test-tools/tests/diagnosticsCases/factorize/import-module/stats.err: Language not supported
Comments suppressed due to low confidence (1)
crates/rspack_core/src/compiler/module_executor/execute.rs:82
- Ensure that the join method is imported (e.g. from the itertools crate) or use an alternative approach (such as collecting into a Vec and then joining) since join is not part of the standard Iterator trait.
error: Some(diagnostics.iter().map(|d| d.to_string()).join("\n")),
✅ Deploy Preview for rspack canceled.
|
CodSpeed Performance ReportMerging #10136 will not alter performanceComparing Summary
|
Summary
fix #9931
Checklist