T
TanStack2mo ago
continuing-cyan

Defaultssr -> false not working with tanstack start

getting empty screen while using defaultssr to false in tanstack start
16 Replies
continuing-cyan
continuing-cyanOP2mo ago
export function createRouter() { const queryClient = new QueryClient() return routerWithQueryClient( createTanStackRouter({ routeTree, context: { queryClient }, // defaultPreload: 'intent', defaultErrorComponent: () => <div>Error</div>, defaultNotFoundComponent: () => <div>Not Found</div>, defaultSsr: false, }), queryClient, ) } I am using like this
grumpy-cyan
grumpy-cyan2mo ago
You need to at least render the html tags and scripts You can do this with the shellComponent option
continuing-cyan
continuing-cyanOP2mo ago
I am rendering all the tags in the __root.tsx file and that's working untill I make the defaultssr to false
grumpy-cyan
grumpy-cyan2mo ago
Add shellComponent: RootDocument in `__root.tsx``
quickest-silver
quickest-silver2mo ago
i've got the same issue here question regarding this, do i remove the component in __root.tsx and just replace it with shellComponet? or do i keep the component and only have the rootDocument component there ass oposed to the entire block?
grumpy-cyan
grumpy-cyan2mo ago
you keep both
quickest-silver
quickest-silver2mo ago
Thanks
rare-sapphire
rare-sapphire2mo ago
Is this the right way? I had to remove the component and use just the shellComponent. Otherwise I get the error
rare-sapphire
rare-sapphire2mo ago
No description
rare-sapphire
rare-sapphire2mo ago
I don't see the usage of component : RootComponent in the docs. Just the shellComponent
rare-sapphire
rare-sapphire2mo ago
rare-sapphire
rare-sapphire2mo ago
If I comment // component: RootComponent my app works
rare-sapphire
rare-sapphire2mo ago
No description
rare-sapphire
rare-sapphire2mo ago
It looks I'm nesting the html
grumpy-cyan
grumpy-cyan2mo ago
Use the RootDocument as the shell instead of the RootComponent

Did you find this page helpful?