T
TanStack2w ago
eastern-cyan

[RC] ssr: false causes renderToPipeableStream error

I get this error with a simple component in a simple route. If I remove ssr prop it renders normally.
7 Replies
eastern-cyan
eastern-cyanOP2w ago
Versions used:

"@tanstack/react-query": "5.90.2",
"@tanstack/react-query-devtools": "5.90.2",
"@tanstack/react-router": "1.132.6",
"@tanstack/react-router-devtools": "1.132.6",
"@tanstack/react-router-ssr-query": "1.132.6",
"@tanstack/react-start": "1.132.6",
"@tanstack/router-plugin": "1.132.6",
"@tanstack/router-zod-adapter": "1.81.5"

"@tanstack/react-query": "5.90.2",
"@tanstack/react-query-devtools": "5.90.2",
"@tanstack/react-router": "1.132.6",
"@tanstack/react-router-devtools": "1.132.6",
"@tanstack/react-router-ssr-query": "1.132.6",
"@tanstack/react-start": "1.132.6",
"@tanstack/router-plugin": "1.132.6",
"@tanstack/router-zod-adapter": "1.81.5"
I just noticed it works if I navigate to the page through Link after initial render. But get the error If I refresh the page or access this route directly
robust-apricot
robust-apricot2w ago
can you please create a github issue for this including a complete minimal reproducer project?
eastern-cyan
eastern-cyanOP5d ago
Turns out it was the defaultPedingComponent. We were using a custom skeleton that relied on huge client only code. It was easy to miss because it was working with router alone. It might be a good idea to include a note in the docs stating that those defaultComponents are rendered on the server only
robust-apricot
robust-apricot5d ago
not true, they are isomorphic as any other component
eastern-cyan
eastern-cyanOP5d ago
I see. So any component can have client code on it? What if calls a localStorage inside the useState init function? In any case, I decided just to throw the legacy component away, but I will investigate it further later. Maybe some conditional inside of it was returning an non serializable thing
robust-apricot
robust-apricot5d ago
it would fail. so wrap that in a ClientOnly component or disable SSR for that route
eastern-cyan
eastern-cyanOP5d ago
Gotcha. Thanks

Did you find this page helpful?