Summary
In a TanStack Start dev server, the server-function resolver can return undefined when the resolved module exists but the requested export is not available yet. The later SSR RPC call then fails with a generic (intermediate value) is not a function, which hides the actual resolver failure.
The production/build resolver already fails loudly for a missing server-function export. It would be much easier to diagnose dev-only SSR failures if the dev resolver matched that behavior and threw a clear error when mod[exp] is undefined.
Observed behavior
During parallel Playwright SSR requests against a React Start app, the first cold authenticated render intermittently hit this path:
- Route loader calls an extracted server function during SSR.
- Dev resolver resolves the server-function module while the requested export is unavailable.
- Resolver returns
undefined.
createSsrRpc attempts to call it.
- The route renders an error state with a generic
(intermediate value) is not a function failure.
Warming the route once before parallel workers start avoids the race, so this report is about diagnostics/fail-loud behavior rather than asking the resolver to serialize module initialization.
Expected behavior
If the dev resolver finds the module but mod[exp] is undefined or not callable, throw an error that includes at least:
- the server function id / requested export
- the module path or resolved module id, if available
- a message explaining that the export was missing from the dev server-function module
Versions from the affected app
@tanstack/react-start: observed around 1.168.x
@tanstack/react-router: observed around 1.170.x
- Vite dev server
- React 19
Thanks!
Summary
In a TanStack Start dev server, the server-function resolver can return
undefinedwhen the resolved module exists but the requested export is not available yet. The later SSR RPC call then fails with a generic(intermediate value) is not a function, which hides the actual resolver failure.The production/build resolver already fails loudly for a missing server-function export. It would be much easier to diagnose dev-only SSR failures if the dev resolver matched that behavior and threw a clear error when
mod[exp]isundefined.Observed behavior
During parallel Playwright SSR requests against a React Start app, the first cold authenticated render intermittently hit this path:
undefined.createSsrRpcattempts to call it.(intermediate value) is not a functionfailure.Warming the route once before parallel workers start avoids the race, so this report is about diagnostics/fail-loud behavior rather than asking the resolver to serialize module initialization.
Expected behavior
If the dev resolver finds the module but
mod[exp]isundefinedor not callable, throw an error that includes at least:Versions from the affected app
@tanstack/react-start: observed around1.168.x@tanstack/react-router: observed around1.170.xThanks!