Skip to content

@tanstack/react-start RSC build fails in server-fn plugin with Rolldown: this.resolve after plugin driver is dropped #7354

@GregoryHouseMD

Description

@GregoryHouseMD

Which project does this relate to?

Router

Describe the bug

After upgrading @tanstack/react-start from a known-good lockfile using 1.167.57 to 1.167.63 / 1.167.64, pnpm build fails during the RSC production build.

The failure happens in: [plugin tanstack-start-core::server-fn:rsc]

Rolldown reports: Errored while resolving "zod" in this.resolve. Got Plugin driver is already dropped.

This does not appear to be a missing dependency issue. zod and defu are installed and resolvable. The same app code builds successfully on the older TanStack Start lockfile.

Complete minimal reproducer

https://github.com/GregoryHouseMD/tanstack-start-rsc-plugin-driver-repro

Steps to Reproduce the Bug

  1. Clone the minimal reproduction:

    git clone https://github.com/GregoryHouseMD/tanstack-start-rsc-plugin-driver-repro.git
    cd tanstack-start-rsc-plugin-driver-repro
    
  2. Install dependencies: pnpm install

  3. Build: pnpm build

  4. The build fails during [3/5] build rsc environment with:
    [plugin tanstack-start-core::server-fn:rsc] src/server/communityPageInitialData.ts?tss-serverfn-split
    Error: Errored while resolving "zod" in this.resolve. Got Plugin driver is already dropped..

Expected behavior

pnpm build` should complete successfully.

The reproduction uses a documented TanStack Start server function pattern: a top-level Zod schema passed to .inputValidator(...) in a module that exports createServerFn(...), with RSC enabled in vite.config.ts.

Screenshots or Videos

No response

Platform

  • Router / Start Version: @tanstack/react-start 1.167.64
  • OS: macOS arm64, Darwin 25.3.0
  • Browser: N/A, production build failure
  • Browser Version: N/A
  • Bundler: Vite with Rolldown
  • Bundler Version: vite 8.0.10, rolldown 1.0.0-rc.17
  • Node: 25.9.0
  • Package Manager: pnpm 11.0.0

Additional context

This appears to be a regression.

With the same minimal source files:

  • @tanstack/react-start 1.167.64 fails
  • @tanstack/react-start 1.167.57 builds successfully

The failure does not appear to be a missing zod dependency. zod is installed and resolvable. The error is thrown while the TanStack Start server-fn RSC plugin is resolving the zod import through this.resolve.

I also tested Vite's Rolldown native plugin settings:

experimental: {
  enableNativePlugin: false,
}

and:

experimental: {
  enableNativePlugin: 'resolver',
}

Both reproduced the same failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions