T
TanStack5mo ago
other-emerald

Defaultssr -> false not working with tanstack start

getting empty screen while using defaultssr to false in tanstack start
16 Replies
other-emerald
other-emeraldOP5mo 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
extended-salmon5mo ago
You need to at least render the html tags and scripts You can do this with the shellComponent option
other-emerald
other-emeraldOP5mo 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
extended-salmon5mo ago
Add shellComponent: RootDocument in `__root.tsx``
stormy-gold
stormy-gold5mo 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
extended-salmon5mo ago
you keep both
stormy-gold
stormy-gold5mo ago
Thanks
other-emerald
other-emerald5mo ago
Is this the right way? I had to remove the component and use just the shellComponent. Otherwise I get the error
other-emerald
other-emerald5mo ago
No description
other-emerald
other-emerald5mo ago
I don't see the usage of component : RootComponent in the docs. Just the shellComponent
other-emerald
other-emerald5mo ago
other-emerald
other-emerald5mo ago
If I comment // component: RootComponent my app works
other-emerald
other-emerald5mo ago
No description
other-emerald
other-emerald5mo ago
It looks I'm nesting the html
extended-salmon
extended-salmon5mo ago
Use the RootDocument as the shell instead of the RootComponent

Did you find this page helpful?