Start RSC mode: server functions imported only from 'use client' modules are missing from the production manifest ("Server function info not found") #7943
Send to my agentWhich 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
npm run dev, open http://localhost:3000, click both buttons. Both succeed.npm run build && npm start, open http://localhost:3000.- Click "Call getCount". It succeeds. This function is imported from the route file.
- Click "Call updateCount". HTTP 500, and the server logs
Server function info not found for 4871320a…. This function is imported only fromCounter.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-start1.168.40,@tanstack/react-router1.170.23 - OS: macOS (darwin 25.5.0)
- Browser: Chrome
- Bundler: vite
- Bundler Version: vite 8.2.1,
@vitejs/plugin-rsc0.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.
G4RDS(GitHub profile, opens in a new tab) closed this
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!
G4RDS(GitHub profile, opens in a new tab) reopened this
@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?
+1 Same issue.
Sheraff(GitHub profile, opens in a new tab) linked this to #8817
Sign in to join this conversation.
is this not an actual issue?