[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
other-emeraldOP•3mo ago
Versions used:
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
conscious-sapphire•3mo ago
can you please create a github issue for this including a complete minimal reproducer project?
other-emeraldOP•2mo 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
conscious-sapphire•2mo ago
not true, they are isomorphic as any other component
other-emeraldOP•2mo 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
conscious-sapphire•2mo ago
it would fail. so wrap that in a ClientOnly component
or disable SSR for that route
other-emeraldOP•2mo ago
Gotcha. Thanks
