-
-
Notifications
You must be signed in to change notification settings - Fork 757
fix: dynamic entry panic when disable build cache #12696
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
✅ Deploy Preview for rspack canceled.
|
Rsdoctor Bundle Diff Analysis
Found 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
🎉 Size decreased by 256bytes from 47.90MB to 47.90MB (⬇️0.00%) |
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
Footnotes
|
c2f0f0a to
fe8a80a
Compare
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 pull request fixes a panic that occurs in the dynamic entry plugin when the build cache is disabled. The issue arises because the plugin maintains a persistent map of dependency IDs across builds, but when cache is disabled, the module graph is cleared between builds, causing dependency lookups to fail.
Changes:
- Modified
rspack_plugin_dynamic_entryto usetry_dependency_by_idinstead ofdependency_by_idto handle missing dependencies gracefully - Added a test case to verify dynamic entries work correctly with cache disabled
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/rspack_plugin_dynamic_entry/src/lib.rs | Changed dependency lookup from panicking dependency_by_id to graceful try_dependency_by_id and added internal import |
| tests/rspack-test/watchCases/entries/dynamic-entries-no-cache/rspack.config.js | Test configuration for dynamic entries with cache disabled across two build steps |
| tests/rspack-test/watchCases/entries/dynamic-entries-no-cache/test.config.js | Test validation configuration (returns empty bundle array) |
| tests/rspack-test/watchCases/entries/dynamic-entries-no-cache/0/index0.js | Test entry file for first build step |
| tests/rspack-test/watchCases/entries/dynamic-entries-no-cache/1/index0.js | Test entry file for second build step |
| tests/rspack-test/watchCases/entries/dynamic-entries-no-cache/1/index1.js | Additional test entry file for second build step |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
fix: dynamic entry panic when disable build cache
We should use
internal::try_dependency_by_idto check if dependency exist in dynamic entry plugin.Related links
Checklist