Defaultssr -> false not working with tanstack start
getting empty screen while using defaultssr to false in tanstack start
16 Replies
continuing-cyanOP•2mo 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•2mo ago
You need to at least render the html tags and scripts
You can do this with the shellComponent option
continuing-cyanOP•2mo 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•2mo ago
Add
shellComponent: RootDocument
in `__root.tsx``quickest-silver•2mo 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•2mo ago
you keep both
quickest-silver•2mo ago
Thanks
rare-sapphire•2mo ago
Is this the right way? I had to remove the component and use just the shellComponent. Otherwise I get the error
rare-sapphire•2mo ago

rare-sapphire•2mo ago
I don't see the usage of component : RootComponent in the docs. Just the shellComponent
rare-sapphire•2mo ago
React TanStack Start Start Basic Example | TanStack Start Docs
An example showing how to implement Start Basic in React using TanStack Start.
rare-sapphire•2mo ago
If I comment // component: RootComponent my app works
rare-sapphire•2mo ago

rare-sapphire•2mo ago
It looks I'm nesting the html
grumpy-cyan•2mo ago
Use the RootDocument as the shell instead of the RootComponent
rare-sapphire•2mo ago
Like this setup ? https://discord.com/channels/719702312431386674/1394197796592291859