Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssr:false does not work when route component is exported #3459

Open
flodaniel opened this issue Feb 17, 2025 · 1 comment
Open

ssr:false does not work when route component is exported #3459

flodaniel opened this issue Feb 17, 2025 · 1 comment
Labels
start Everything about TanStack Start

Comments

@flodaniel
Copy link

Which project does this relate to?

Start

Describe the bug

I caught this when wondering why ssr:false would simply not work. After a lot of comparision to the start-basic example i discovered that if the Route Component is exported the page will be server-side rendered even if ssr:false or defaultSsr:false is set.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-wsyr4gwp?file=app%2Froutes%2F_layout.tsx

Steps to Reproduce the Bug or Issue

  1. ssr:false in _layout.tsx and LayoutComponent is not exported. "I am a layout" is missing from the server response. This works as expected

Image

  1. export the LayoutComponentin _layout.tsx. Notice that the "I am a layout" is now present in the server response.

Image

Expected behavior

No matter if the Route Component is exported or not, ssr:false should work. If this is not possible, a warning in the docs would be great.

Screenshots or Videos

No response

Platform

  • OS: any
  • Browser: Brave
  • Version: latest

Additional context

No response

@SeanCassiere SeanCassiere added the start Everything about TanStack Start label Feb 17, 2025
@flodaniel
Copy link
Author

Similar to this ssr:false also does not work for any defined errorComponent and notFoundComponent which leads to layout shifts in my app as the component is a layout that adds additional UI:

export const Route = createFileRoute("/_baseLayout")({
    component: BaseProviderLayout,
    errorComponent: RootErrorBoundary,
    notFoundComponent: NotFound,
    ssr: false,
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
start Everything about TanStack Start
Projects
None yet
Development

No branches or pull requests

2 participants