Skip to content
Source
Sign inSign up
TanStack/router

fix(start): handle Cloudflare SPA fallback hydration mismatch #6481

Openkyu-rong(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/6481/headopened

Showing 3 changed files with 215 additions and 1 deletion (loading 1).

x
0 of 3 viewed, 3 left
21 additions and 1 deletionpackages/start-client-core/src/client/hydrateStart.tsModified
View file
@@ -1,4 +1,7 @@
import { hydrate } from '@tanstack/router-core/ssr/client'
+import {
+ trimPathRight,
+} from '@tanstack/router-core'
​
import { ServerFunctionSerializationAdapter } from './ServerFunctionSerializationAdapter'
import type { AnyStartInstanceOptions } from '../createStart'
@@ -8,6 +11,12 @@
// eslint-disable-next-line import/no-duplicates,import/order
import { startInstance } from '#tanstack-start-entry'
​
+declare global {
+ interface Window {
+ __TSS_SPA_SHELL__?: boolean
+ }
+}
+​
export async function hydrateStart(): Promise<AnyRouter> {
const router = await getRouter()
​
@@ -36,7 +45,18 @@
...{ serializationAdapters },
})