-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
Which project does this relate to?
Start
Describe the bug
When deploying a TanStack Start application with spa mode enabled to Cloudflare, directly navigating to a non-root route (e.g., /example) results in a React hydration error. The same route works correctly when accessed via client-side navigation (e.g., clicking a <Link> from /).
On direct navigation to a non-root route, React throws a hydration mismatch error and the page visibly flashes:
Hydration failed because the server rendered HTML didn't match the client.
As a result this tree will be regenerated on the client.
Error reference: https://react.dev/errors/418?args[]=HTML&args[]=
This issue appears to be directly related to Cloudflare's SPA handling configuration:
"not_found_handling": "single-page-application"Your Example Website or App
https://github.com/bbertold/tanstack-start-spa
Steps to Reproduce the Bug or Issue
- Clone the reproduction repository
- Build the application:
pnpm build - Preview the build:
pnpm preview - Open browser and navigate directly to
/examplein the URL bar - Press Enter
- Observe the hydration error in console and visible flash of content
Expected behavior
The page should load without hydration errors.
Screenshots or Videos
No response
Platform
- Router / Start Version: 1.154.8
- OS: macOS
- Browser: Chrome (144.0.7559.59)
- Bundler: Vite (7.1.7)
- Wrangler version: 4.60.0
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels