fix(start): skip errored Rspack modules during import protection - #7685
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 bf247d6
☁️ Nx Cloud last updated this comment at |
Merging this PR will degrade performance by 5.49%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | mem server serialization-payload (react) |
3.4 MB | 5.2 MB | -33.27% |
| ❌ | Memory | mem server request-churn (react) |
492.1 KB | 538.2 KB | -8.57% |
| ❌ | Simulation | client-async-pipeline navigation loop (react) |
49.9 ms | 51.7 ms | -3.62% |
| ⚡ | Memory | mem server error-paths unmatched (react) |
297.6 KB | 264.9 KB | +12.33% |
| ⚡ | Memory | mem server error-paths not-found (react) |
277.4 KB | 267 KB | +3.9% |
| ⚡ | Memory | mem server server-fn-churn (react) |
281.8 KB | 271.4 KB | +3.81% |
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 (bf247d6) with main (179d9b9)
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
…-dev # Conflicts: # pnpm-lock.yaml
…-dev # Conflicts: # pnpm-lock.yaml
|
@schiller-manuel I received user feedback about the following issue they encountered during development. Could you please merge this PR when you have time? |
There was a problem hiding this comment.
Nx Cloud has identified a possible root cause for your failed CI:
We identified that this failure is unrelated to the PR's changes. The test crashes before execution due to a stale build artifact in e2e/e2e-utils/dist/esm/index.js, where a named export toRuntimePath no longer exists in the compiled output. Rebuilding the e2e-utils package should resolve this environment state issue.
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
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