Skip to content
Source
Sign inSign up
TanStack/router

Solid Start: `beforeLoad` with `ssr: false` and a `pendingComponent` leads to hydration mismatch #5787

Send to my agent
Closedteidesu(GitHub profile, opens in a new tab) opened this issue 1 comment

Which project does this relate to?

Start

Describe the bug

/subj. removing any of the listed features (i.e enabling ssr, removing pendingComponent or removing beforeLoad) fixes this issue

Your Example Website or App

https://stackblitz.com/edit/vitejs-vite-nrks9gdy?file=src%2Froutes%2F__root.tsx

Steps to Reproduce the Bug or Issue

  1. open the linked repro
  2. pnpm i && vite dev
  3. notice that the loading div disappears when hydrating, but the page content doesn't appear, and instead there's a hydration error in the console:
Image

Expected behavior

i expected everything to work

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.134.14
  • OS: macOS
  • Browser: Chrome
  • Browser Version: 141
  • Bundler: vite
  • Bundler Version: 7.2.2

Additional context

tbh the existence of this hydration error itself is kinda weird because when i use ssr: false on root i'd expect the app to be fully spa i.e. not having the hydration step at all...

  1. THrough a bit of testing i found out its due to defaultPendingMinMs

    const router = createRouter({
        routeTree,
        scrollRestoration: true,
        defaultPendingMinMs: 0,
      });

Sign in to join this conversation.