fix(frontend): pre-bundle every base-ui entry point, not the bystander - #2399
Conversation
The xlsx export story keeps failing with "Failed to fetch dynamically imported module … exceljs.js", and adding `exceljs` to the pre-bundled list did not stop it. It was never the cause. The line above it in the run output names the cause: "new dependencies optimized: @base-ui/react/merge-props", then "optimized dependencies changed. reloading". A late-discovered dependency makes vite reload the page, and the reload kills whichever import is in flight. That is reported as a failure of the import — so the slowest thing to load takes the blame for something it did not do. Nine of the eighteen `@base-ui/react/*` entry points the source imports were missing from the list. Any of them can be the one discovered late, so all eighteen are listed now rather than the one that happened to surface. The comment carries the rule that would have saved a round: read the dependency named by "new dependencies optimized", never the test that failed. Verified on a cold cache — both `node_modules/.vite` and the storybook cache removed — by the absence of the mechanism rather than by a passing run: no "new dependencies optimized" line appears at all, where CI logged one for merge-props. 1041 tests pass across both projects. Signed-off-by: Alexey Panfilov <Alexey.Panfilov@constructor.tech>
|
Warning Review limit reached
Next review available in: 16 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
maincurrently carries a storybook test that fails on some runs and not others. #2398 was meant to stop it and did not — the dependency it added was a bystander.What is actually happening
The failure reads:
The line above it in the same run names the cause:
A dependency reached only after a story mounts is discovered mid-run. Vite re-optimizes and reloads the page, and the reload kills whichever import is in flight. That import is reported as the failure — so the slowest thing to load takes the blame for something it did not do.
exceljsis simply the slowest thing in that suite.The change
Nine of the eighteen
@base-ui/react/*entry points the source imports were missing fromoptimizeDeps.include. Any one of them can be the late discovery, so all eighteen are listed rather than the one that surfaced this week.The comment now carries the rule that would have saved a round: read the dependency named by "new dependencies optimized", never the test that failed — and a one-liner to check the set still matches the source.
exceljsstays. It is genuinely imported dynamically and belongs on the list; it was just not the cause.Verification
Cold cache, both
node_modules/.viteand the storybook cache removed, and verified by the absence of the mechanism rather than by a run that happened to pass: no "new dependencies optimized" line appears at all, where CI logged one formerge-props. 1041 tests pass across both projects,tsc -bclean.That distinction matters here. #2398 was also "verified" by a passing queue run, and the same failure appeared two runs later — a green run proves nothing about a race, only the missing trigger does.