Skip to content

Conversation

@SyMind
Copy link
Member

@SyMind SyMind commented Jan 12, 2026

Summary

fix: dynamic entry panic when disable build cache

We should use internal::try_dependency_by_id to check if dependency exist in dynamic entry plugin.

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link

netlify bot commented Jan 12, 2026

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 0c55a86
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/69649355297b2b000801fb14

@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Jan 12, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 12, 2026

Rsdoctor Bundle Diff Analysis

⚠️ Note: The latest commit (eb5635c6f2) does not have baseline artifacts. Using commit df72860770 for baseline comparison instead. If this seems incorrect, please wait a few minutes and try rerunning the workflow.

Found 5 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB 0
react-1k 825.4 KB 0
react-5k 2.7 MB 0
rome 984.3 KB 0
ui-components 2.1 MB 0

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

github-actions bot commented Jan 12, 2026

📦 Binary Size-limit

Comparing 0c55a86 to feat: impl sync_trace for logger tracing layer (#12687) by CPunisher

🎉 Size decreased by 256bytes from 47.90MB to 47.90MB (⬇️0.00%)

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 12, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing fix-dynamic-entry-panic (0c55a86) with main (df72860)

Summary

✅ 16 untouched benchmarks
⏩ 1 skipped benchmark1

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

@SyMind SyMind force-pushed the fix-dynamic-entry-panic branch from c2f0f0a to fe8a80a Compare January 12, 2026 03:34
@SyMind SyMind marked this pull request as ready for review January 12, 2026 03:42
Copilot AI review requested due to automatic review settings January 12, 2026 03:42
Copy link
Contributor

Copilot AI left a 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_entry to use try_dependency_by_id instead of dependency_by_id to 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.

@SyMind SyMind requested a review from quininer as a code owner January 12, 2026 06:23
@SyMind SyMind merged commit 6256796 into main Jan 13, 2026
121 of 130 checks passed
@SyMind SyMind deleted the fix-dynamic-entry-panic branch January 13, 2026 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants