Skip to content

fix(start): skip errored Rspack modules during import protection#7685

Draft
SyMind wants to merge 3 commits into
TanStack:mainfrom
SyMind:fix-tanstack-router-dev
Draft

fix(start): skip errored Rspack modules during import protection#7685
SyMind wants to merge 3 commits into
TanStack:mainfrom
SyMind:fix-tanstack-router-dev

Conversation

@SyMind

@SyMind SyMind commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Fixes a dev-mode recovery bug where invalid JS/TS code could produce a Rspack compiler-level error from import protection, leaving rsbuild dev unable to recover even after the user fixed the source code.

Changes:

  • Skip already-errored Rspack modules while building the import protection compilation graph.
  • Ensure the original syntax error is surfaced through the Rsbuild error overlay instead of a secondary Compilation.hooks.processAssets plugin error.
  • Add RSC Rsbuild e2e coverage that injects invalid route code and snapshots the client/server error overlay.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 412703e9-f425-4e86-b070-bf96208a546e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

# 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
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​rsbuild/​core@​2.1.0-rc.01001008498100

View full report

@socket-security

Copy link
Copy Markdown

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.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm @emnapi/runtime is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: pnpm-lock.yamlnpm/nitro@3.0.1-alpha.2npm/nitro@3.0.260311-betanpm/@rsbuild/core@2.1.0-rc.0npm/@swc-node/register@1.11.1npm/@emnapi/runtime@1.11.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@emnapi/runtime@1.11.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant