fix(start): skip errored Rspack modules during import protection#7685
fix(start): skip errored Rspack modules during import protection#7685SyMind wants to merge 11 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughBumps Changesrsbuild 2.1.0 upgrade, import-protection fix, and rsbuild E2E fixture
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related issues
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
# Conflicts: # benchmarks/bundle-size/package.json # e2e/react-router/rspack-basic-file-based/package.json # e2e/react-router/rspack-basic-virtual-named-export-config-file-based/package.json # e2e/react-start/basic/package.json # e2e/react-start/css-inline/package.json # e2e/react-start/custom-server-rsbuild/package.json # e2e/react-start/deferred-hydration/package.json # e2e/react-start/hmr/package.json # e2e/react-start/import-protection/package.json # e2e/react-start/rsc/package.json # e2e/react-start/server-functions/package.json # e2e/solid-router/rspack-basic-file-based/package.json # e2e/solid-router/rspack-basic-virtual-named-export-config-file-based/package.json # e2e/solid-start/basic/package.json # e2e/solid-start/deferred-hydration/package.json # e2e/vue-router/rspack-basic-file-based/package.json # e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/package.json # e2e/vue-start/basic/package.json # examples/react/quickstart-rspack-file-based/package.json # examples/solid/quickstart-rspack-file-based/package.json # packages/react-start/package.json # packages/solid-start/package.json # packages/start-plugin-core/package.json # packages/vue-start/package.json # pnpm-lock.yaml
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@e2e/react-start/rsc-rsbuild/tests/error-overlay.spec.ts`:
- Around line 28-44: The DevServer startup path currently waits only on
waitUntilReady(), so a spawn failure from pnpm/rsbuild can hang until timeout
instead of failing immediately. In the DevServer.start method, add an error
listener to the spawned process and surface that error right away, ideally
before or alongside the waitUntilReady() flow, so startup failures are reported
immediately instead of being masked by the timeout.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 666b748c-f5f5-4855-9201-a1019bf10caf
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (28)
benchmarks/bundle-size/package.jsone2e/react-router/rspack-basic-file-based/package.jsone2e/react-router/rspack-basic-virtual-named-export-config-file-based/package.jsone2e/react-start/basic/package.jsone2e/react-start/css-inline/package.jsone2e/react-start/custom-server-rsbuild/package.jsone2e/react-start/deferred-hydration/package.jsone2e/react-start/hmr/package.jsone2e/react-start/import-protection/package.jsone2e/react-start/rsc-rsbuild/package.jsone2e/react-start/rsc-rsbuild/tests/error-overlay.spec.tse2e/react-start/rsc/package.jsone2e/react-start/server-functions/package.jsone2e/solid-router/rspack-basic-file-based/package.jsone2e/solid-router/rspack-basic-virtual-named-export-config-file-based/package.jsone2e/solid-start/basic/package.jsone2e/solid-start/deferred-hydration/package.jsone2e/vue-router/rspack-basic-file-based/package.jsone2e/vue-router/rspack-basic-virtual-named-export-config-file-based/package.jsone2e/vue-start/basic/package.jsonexamples/react/quickstart-rspack-file-based/package.jsonexamples/solid/quickstart-rspack-file-based/package.jsonpackages/react-start/package.jsonpackages/router-plugin/package.jsonpackages/solid-start/package.jsonpackages/start-plugin-core/package.jsonpackages/start-plugin-core/src/rsbuild/import-protection.tspackages/vue-start/package.json
|
@codex review |
|
View your CI Pipeline Execution ↗ for commit f3a5c57
☁️ Nx Cloud last updated this comment at |
Merging this PR will regress 2 benchmarks
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | mem server server-fn-churn (react) |
270.9 KB | 282.2 KB | -3.98% |
| ❌ | Memory | mem server error-paths not-found (react) |
266.6 KB | 277.1 KB | -3.76% |
| ⚡ | Memory | mem server peak-large-page (react) |
2,184.3 KB | 953.9 KB | ×2.3 |
| ⚡ | Memory | mem server error-paths not-found (solid) |
763 KB | 422.4 KB | +80.65% |
| ⚡ | Memory | mem server peak-large-page (solid) |
1,386.8 KB | 772.9 KB | +79.42% |
| ⚡ | Memory | mem server serialization-payload (react) |
5.2 MB | 3.5 MB | +48.9% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing SyMind:fix-tanstack-router-dev (8a2546c) with main (07ce903)
There was a problem hiding this comment.
Important
At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.
Nx Cloud has identified a possible root cause for your failed CI:
We investigated this failure and found it to be an environmental issue unrelated to the PR's changes. The test shard encountered EADDRINUSE: address already in use :::40891, meaning a stale process had already claimed the dynamically assigned port before the web server could start. A clean re-run should resolve this without any code changes needed.
No code changes were suggested for this issue.
You can trigger a rerun by pushing an empty commit:
git commit --allow-empty -m "chore: trigger rerun"
git push
🎓 Learn more about Self-Healing CI on nx.dev
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@e2e/react-start/rsbuild/server.js`:
- Around line 32-49: The start() helper currently only handles the child process
“exit” path, so a failed srvx launch from spawn() can surface as an uncaught
“error” event instead of a controlled failure. Update start() to attach an
“error” handler on the spawned child and terminate the process deterministically
with a clear startup failure when srvx cannot be launched, alongside the
existing exit handling in child.on('exit').
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6f2cab84-c020-40b7-a57d-4ab8abbce359
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (12)
e2e/react-start/rsbuild/.gitignoree2e/react-start/rsbuild/.prettierignoree2e/react-start/rsbuild/package.jsone2e/react-start/rsbuild/playwright.config.tse2e/react-start/rsbuild/rsbuild.config.tse2e/react-start/rsbuild/server.jse2e/react-start/rsbuild/src/routeTree.gen.tse2e/react-start/rsbuild/src/router.tsxe2e/react-start/rsbuild/src/routes/__root.tsxe2e/react-start/rsbuild/src/routes/index.tsxe2e/react-start/rsbuild/tests/error-overlay.spec.tse2e/react-start/rsbuild/tsconfig.json
💤 Files with no reviewable changes (1)
- e2e/react-start/rsbuild/tests/error-overlay.spec.ts
✅ Files skipped from review due to trivial changes (4)
- e2e/react-start/rsbuild/.prettierignore
- e2e/react-start/rsbuild/.gitignore
- e2e/react-start/rsbuild/playwright.config.ts
- e2e/react-start/rsbuild/src/routeTree.gen.ts
# Conflicts: # e2e/react-router/rspack-basic-file-based/package.json # e2e/react-router/rspack-basic-virtual-named-export-config-file-based/package.json # e2e/react-start/basic/package.json # e2e/react-start/css-inline/package.json # e2e/react-start/custom-server-rsbuild/package.json # e2e/react-start/hmr/package.json # e2e/react-start/import-protection/package.json # e2e/react-start/rsc-rsbuild/package.json # e2e/react-start/rsc/package.json # e2e/react-start/server-functions/package.json # e2e/solid-router/rspack-basic-file-based/package.json # e2e/solid-router/rspack-basic-virtual-named-export-config-file-based/package.json # e2e/solid-start/basic/package.json # e2e/vue-router/rspack-basic-file-based/package.json # e2e/vue-router/rspack-basic-virtual-named-export-config-file-based/package.json # e2e/vue-start/basic/package.json # pnpm-lock.yaml
Fixes a dev-mode recovery bug where invalid JS/TS code could produce a Rspack compiler-level error from import protection, leaving
rsbuild devunable to recover even after the user fixed the source code.Changes:
Compilation.hooks.processAssetsplugin error.Summary by CodeRabbit