Which project does this relate to?
Router
Describe the bug
packages/router-core/src/ssr/types.ts declares:
export interface DehydratedMatch {
i: MakeRouteMatch['id']
b?: MakeRouteMatch['__beforeLoadContext']
...
}
RouteMatch['__beforeLoadContext'] is tagged @internal. Since #4907 ("refactor(router-core): strip internal types from public build", 2025-08-10) enabled stripInternal repo-wide, that field has been removed from the published .d.ts — but this indexed-access reference to it was never updated, so it's been a dangling reference in every published .d.ts since router-core@1.171.16 (2026-08-04). #6118 later moved the interface to its current file unchanged, carrying the bug forward.
It went unnoticed by plain SPA consumers because nothing in the always-imported client path pulled ssr/types.ts into their type graph — until #7805's load-client.ts rewrite (also 2026-08-04) started importing TsrSsrGlobal from ./ssr/types.
Complete minimal reproducer
https://stackblitz.com/edit/tanstack-tsc-bug-rlvy22xm
Steps to Reproduce the Bug
npm install && npx tsc in the example repo
Observe that tsc fails on router-core's own shipped types:
node_modules/@tanstack/router-core/dist/esm/ssr/types.d.ts(5,24):
error TS2339: Property '__beforeLoadContext' does not exist on type 'MakeRouteMatch'.
Expected behavior
tsc passes against a stock createRouter/createRootRoute setup with default compiler options.
Screenshots or Videos
No response
Platform
- @tanstack/react-router: 1.170.32 (latest as of writing; bug present since 1.170.19 / router-core 1.171.16, 2026-08-04)
- @tanstack/router-core: 1.171.27 (latest as of writing; broken since 1.171.16)
- TypeScript: 7.0.2
Additional context
No response
Which project does this relate to?
Router
Describe the bug
packages/router-core/src/ssr/types.tsdeclares:RouteMatch['__beforeLoadContext']is tagged@internal. Since #4907 ("refactor(router-core): strip internal types from public build", 2025-08-10) enabledstripInternalrepo-wide, that field has been removed from the published.d.ts— but this indexed-access reference to it was never updated, so it's been a dangling reference in every published.d.tssincerouter-core@1.171.16(2026-08-04). #6118 later moved the interface to its current file unchanged, carrying the bug forward.It went unnoticed by plain SPA consumers because nothing in the always-imported client path pulled
ssr/types.tsinto their type graph — until #7805'sload-client.tsrewrite (also 2026-08-04) started importingTsrSsrGlobalfrom./ssr/types.Complete minimal reproducer
https://stackblitz.com/edit/tanstack-tsc-bug-rlvy22xm
Steps to Reproduce the Bug
npm install && npx tscin the example repoObserve that
tscfails on router-core's own shipped types:node_modules/@tanstack/router-core/dist/esm/ssr/types.d.ts(5,24):
error TS2339: Property '__beforeLoadContext' does not exist on type 'MakeRouteMatch'.
Expected behavior
tscpasses against a stockcreateRouter/createRootRoutesetup with default compiler options.Screenshots or Videos
No response
Platform
Additional context
No response