Skip to content

Start RSC mode: server functions imported only from 'use client' modules are missing from the production manifest ("Server function info not found") #7943

Open

Description

@G4RDS

Which project does this relate to?

Start

Describe the bug

With RSC mode enabled (tanstackStart({ rsc: { enabled: true } })), a module that declares a server function with createServerFn() but is only imported from a 'use client' module works in vite dev and fails in a production build at call time:

Error: Server function info not found for 4871320a42e02f1456100b5f8ab1447a1b455d58d8cdc316bd1cbe505ccd1e24
    at Module.getServerFnById (dist/server/rsc/index.js:2900:27)
    at getServerFnById (dist/server/assets/createServerFn-….js:133:61)
    at async handleServerAction (dist/server/server.js:10770:17)

The client bundle contains the RPC stub with the generated function ID, but the server-fn resolver manifest in the rsc output (dist/server/rsc/index.js) has no entry for that ID, so every invocation returns HTTP 500.

Server functions whose defining modules are also reachable from route files or server components are registered fine. Only the ones reachable exclusively through a 'use client' boundary are missing.

Building the same project with rsc: false produces a complete manifest, so this is specific to RSC mode.

Complete minimal reproducer

https://github.com/G4RDS/tanstack-router-7943-repro

Steps to Reproduce the Bug

git clone https://github.com/G4RDS/tanstack-router-7943-repro
cd tanstack-router-7943-repro
npm install
  1. npm run dev, open http://localhost:3000, click both buttons. Both succeed.
  2. npm run build && npm start, open http://localhost:3000.
  3. Click "Call getCount". It succeeds. This function is imported from the route file.
  4. Click "Call updateCount". HTTP 500, and the server logs Server function info not found for 4871320a…. This function is imported only from Counter.tsx, which is a 'use client' component.

It can also be verified without starting the server:

$ grep -o 'functionName: "[^"]*"' dist/server/rsc/index.js
functionName: "getCountServerFn_createServerFn_handler"
functionName: "getPage_createServerFn_handler"
# updateCountServerFn_createServerFn_handler is missing

$ grep -oh '[0-9a-f]\{64\}' dist/client/assets/*.js | sort -u | wc -l
3   # the client bundle references all three IDs, including the missing one

Expected behavior

Server functions referenced only from 'use client' modules should be registered in the production manifest, so that calling them in a production build behaves the same as in dev.

Platform

  • Router / Start Version: @tanstack/react-start 1.168.40, @tanstack/react-router 1.170.23
  • OS: macOS (darwin 25.5.0)
  • Browser: Chrome
  • Bundler: vite
  • Bundler Version: vite 8.2.1, @vitejs/plugin-rsc 0.5.34

Transitive Start packages, for reference: @tanstack/start-plugin-core 1.171.31, @tanstack/start-client-core 1.170.19, @tanstack/start-server-core 1.169.23. Node 22.15.1.

Additional context

The 500 is not observable from application code. The call does not reject, it resolves with undefined, so a try/catch around it never runs:

try {
  const res = await updateCount({ data: { addBy: 1 } })
  setResult(JSON.stringify(res)) // res is undefined, so this sets undefined
} catch (err) {
  // never reached
  setResult(`ERROR: ${err instanceof Error ? err.message : String(err)}`)
}

The response for the failing call is {"status":500,"unhandled":true,"message":"HTTPError"} with content-type: application/json. The Server function info not found message appears only in the server log.

Errors thrown inside a server function handler do reject on the client as expected, so this seems limited to this failure.

Activity

  1. schiller-manuel commented on Aug 3, 2026

    @schiller-manuel
    Collaborator

    is this not an actual issue?

  2. G4RDS commented on Aug 7, 2026

    @G4RDS
    Author

    Sorry for the confusion.

    Honestly, I closed the issue because my AI agent created it before I had done enough investigation on my end 😓

    I’ll clean it up and reopen it as soon as possible with a proper reproduction!

  3. reopened this on Aug 9, 2026
  4. G4RDS commented on Aug 9, 2026

    @G4RDS
    Author

    @schiller-manuel

    Reopened with a minimal reproducer and a rewritten description.
    Repro: https://github.com/G4RDS/tanstack-router-7943-repro

    Could you take another look when you get a chance?

  5. toitzi commented on Aug 20, 2026

    @toitzi

    +1 Same issue.

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

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