Skip to content

fix(start-plugin-core): handle dropped plugin driver during resolve#7371

Open
aartisonigra wants to merge 2 commits intoTanStack:mainfrom
aartisonigra:fix/rsc-plugin-driver-error
Open

fix(start-plugin-core): handle dropped plugin driver during resolve#7371
aartisonigra wants to merge 2 commits intoTanStack:mainfrom
aartisonigra:fix/rsc-plugin-driver-error

Conversation

@aartisonigra
Copy link
Copy Markdown

@aartisonigra aartisonigra commented May 9, 2026

Summary

Fixes a Rolldown RSC build regression where this.resolve() could throw:

Plugin driver is already dropped

during server function resolution in the tanstack-start-core::server-fn:rsc plugin.

Changes

  • Wrapped this.resolve() in a try/catch
  • Gracefully handle dropped plugin driver errors by returning null
  • Added DevEnvironment and HotUpdateOptions typings for improved type safety

Reproduction

The issue was reproducible with:

  • @tanstack/react-start@1.167.63
  • @tanstack/react-start@1.167.64

and did not occur on:

  • @tanstack/react-start@1.167.57

Result

pnpm build now completes successfully without crashing during the RSC production build when using Rolldown.

Summary by CodeRabbit

  • Chores

    • Added @tanstack/react-start dependency
  • Bug Fixes

    • Enhanced error handling in the compiler plugin for improved build reliability
    • Improved type definitions for more robust module processing

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 9, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ea564aac-1449-454a-88d1-ef156299d705

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
📝 Walkthrough

Walkthrough

This PR adds the @tanstack/react-start production dependency and strengthens the Vite compiler plugin's type safety and error resilience. Vite plugin type imports expand to include DevEnvironment and HotUpdateOptions, which are applied to dev-mode module loading, hot update hooks, and server function resolution to enable proper typing and error handling.

Changes

Vite Plugin Enhancement and Dependencies

Layer / File(s) Summary
Dependencies
package.json
Added @tanstack/react-start@1.167.57 as a production dependency; reordered existing devDependencies entries.
Type Imports
packages/start-plugin-core/src/vite/start-compiler-plugin/plugin.ts
Expanded Vite plugin type imports to include DevEnvironment and HotUpdateOptions for stricter typing.
Module Loading and Hot Updates
packages/start-plugin-core/src/vite/start-compiler-plugin/plugin.ts
Dev-mode transformRequest calls now use DevEnvironment cast; resolveId wrapped in try/catch to gracefully handle "Plugin driver is already dropped" errors; hotUpdate hook parameter explicitly typed as HotUpdateOptions.
Server Function Validation
packages/start-plugin-core/src/vite/start-compiler-plugin/plugin.ts
Dev server-fn ID validator invokes transformRequest via DevEnvironment cast; server-fn-resolver adds explicit return after error call when getServerFnById is not found.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A new dependency hops in,
Types align with crisp precision,
Error catching saves the spin,
Hot updates dance without collision,
Server functions resolve with care—
The plugin blooms beyond compare! 🌸

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(start-plugin-core): handle dropped plugin driver during resolve' accurately summarizes the main change: handling a dropped plugin driver error during the resolve process in the start-plugin-core package.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 `@package.json`:
- Around line 147-149: The package.json currently pins the internal package
"@tanstack/react-start" to an external version; update the dependencies entry
for "@tanstack/react-start" to use the workspace protocol by replacing its
version string with "workspace:*" so the project uses the local workspace
package consistent with the pnpm override.
🪄 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: b9af0de6-be0b-4137-b36b-76e02a9d0664

📥 Commits

Reviewing files that changed from the base of the PR and between 4eed408 and 4e001c8.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • packages/start-plugin-core/src/vite/start-compiler-plugin/plugin.ts

Comment thread package.json
Comment on lines +147 to 149
"dependencies": {
"@tanstack/react-start": "1.167.57"
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Root dependency value:"
jq -r '.dependencies["@tanstack/react-start"] // "<missing>"' package.json

echo "Override value:"
jq -r '.pnpm.overrides["@tanstack/react-start"] // "<missing>"' package.json

echo "Verify this package exists in workspace:"
fd -i 'package.json$' | xargs -r jq -r 'select(.name=="@tanstack/react-start") | input_filename'

Repository: TanStack/router

Length of output: 194


Use workspace protocol for internal @tanstack/react-start dependency

This internal workspace package should use workspace:* instead of a pinned external version to maintain consistency with the pnpm override already set for it.

Proposed change
   "dependencies": {
-    "@tanstack/react-start": "1.167.57"
+    "@tanstack/react-start": "workspace:*"
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"dependencies": {
"@tanstack/react-start": "1.167.57"
}
"dependencies": {
"@tanstack/react-start": "workspace:*"
}
🤖 Prompt for 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.

In `@package.json` around lines 147 - 149, The package.json currently pins the
internal package "@tanstack/react-start" to an external version; update the
dependencies entry for "@tanstack/react-start" to use the workspace protocol by
replacing its version string with "workspace:*" so the project uses the local
workspace package consistent with the pnpm override.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

Bundle Size Benchmarks

  • Commit: 4eed408f127b
  • Measured at: 2026-05-09T07:52:08.264Z
  • Baseline source: history:35e88f04996d
  • Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Initial gzip Raw Brotli Trend
react-router.minimal 87.29 KiB +139 B (+0.16%) 87.15 KiB 274.07 KiB 75.81 KiB ▁▁▁▁▁▁▁▁▁▁▁█
react-router.full 90.82 KiB +141 B (+0.15%) 90.68 KiB 285.58 KiB 78.82 KiB ▁▁▁▁▁▁▁▁▁▁▁█
solid-router.minimal 35.51 KiB +126 B (+0.35%) 35.38 KiB 106.36 KiB 31.91 KiB ▁▁▁▁▁▁▁▁▁▁▁█
solid-router.full 40.23 KiB +127 B (+0.31%) 40.10 KiB 120.58 KiB 36.14 KiB ▁▁▁▁▁▁▁▁▁▁▁█
vue-router.minimal 53.28 KiB +131 B (+0.24%) 53.15 KiB 151.51 KiB 47.83 KiB ▁▁▁▁▁▁▁▁▁▁▁█
vue-router.full 58.41 KiB +133 B (+0.22%) 58.28 KiB 167.68 KiB 52.30 KiB ▁▁▁▁▁▁▁▁▁▁▁█
react-start.minimal 101.97 KiB +141 B (+0.14%) 101.84 KiB 322.51 KiB 88.13 KiB ▁▁▁▁▁▁▁▁▁▁▃█
react-start.full 105.41 KiB +140 B (+0.13%) 105.27 KiB 332.84 KiB 91.10 KiB ▁▁▁▁▁▁▁▁▁▁▄█
react-start.rsbuild.minimal 99.60 KiB +174 B (+0.17%) 99.43 KiB 316.97 KiB 85.65 KiB ▁▁▁▁▁▁▁▁▁▁▄█
react-start.rsbuild.full 102.89 KiB +174 B (+0.17%) 102.72 KiB 327.41 KiB 88.45 KiB ▁▁▁▁▁▁▁▁▁▁▃█
solid-start.minimal 49.61 KiB +131 B (+0.26%) 49.48 KiB 152.48 KiB 43.79 KiB ▁▁▁▁▁▁▁▁▁▁▄█
solid-start.full 55.40 KiB +133 B (+0.24%) 55.27 KiB 169.39 KiB 48.70 KiB ▁▁▁▁▁▁▁▁▁▁▄█

Current gzip tracks all emitted client JS chunks. Initial gzip tracks only the entry/import graph. Trend sparkline is historical current gzip ending with this PR measurement; lower is better.

@aartisonigra
Copy link
Copy Markdown
Author

Hi @tannerlinsley

This PR fixes the Rolldown RSC regression where this.resolve() could throw "Plugin driver is already dropped" during the RSC production build.

I also synced the pnpm lockfile to resolve the CI lockfile mismatch issue. Local builds are now passing successfully.

Please review when you get a chance. Thank you!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant