Defaultssr -> false not working with tanstack start
getting empty screen while using defaultssr to false in tanstack start
16 Replies
other-emeraldOP•5mo 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
extended-salmon•5mo ago
You need to at least render the html tags and scripts
You can do this with the shellComponent option
other-emeraldOP•5mo ago
I am rendering all the tags in the __root.tsx file and that's working untill I make the defaultssr to false
extended-salmon•5mo ago
Add
shellComponent: RootDocument in `__root.tsx``stormy-gold•5mo 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?
extended-salmon•5mo ago
you keep both
stormy-gold•5mo ago
Thanks
other-emerald•5mo ago
Is this the right way? I had to remove the component and use just the shellComponent. Otherwise I get the error
other-emerald•5mo ago

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

other-emerald•5mo ago
It looks I'm nesting the html
extended-salmon•5mo ago
Use the RootDocument as the shell instead of the RootComponent
other-emerald•5mo ago
Like this setup ? https://discord.com/channels/719702312431386674/1394197796592291859