-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Description
Which project does this relate to?
Start
Describe the bug
After upgrading to @tanstack/start-plugin-core@1.158.2, the SSR build fails with:
[tanstack-start-core::server-fn:ssr] createServerOnlyFn() must be called with a function!
This appears related to changes in #6599.
Your Example Website or App
Steps to Reproduce the Bug or Issue
- Create a file with this pattern:
import { createServerOnlyFn } from "@tanstack/react-start";
const myFn = createServerOnlyFn(() => ({ hello: "world" }));
const result = myFn();- Run the
buildscript - The client build succeeds, but the SSR build crashes with:
createServerOnlyFn() must be called with a function!
Expected behavior
myFn() should execute normally during SSR build. Calls to functions returned by createServerOnlyFn should not trigger this error.
Screenshots or Videos
No response
Platform
- Router / Start Version: 1.159.5 (regression introduced in 1.158.2)
- OS: Linux (WSL2)
- Bundler: vite
- Bundler Version: 7.3.1
Additional context
A workaround is to inline the call:
const result = createServerOnlyFn(() => ({ hello: "world" }))();Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels