diff --git a/packages/react/src/tanstackrouter.ts b/packages/react/src/tanstackrouter.ts index 2efefba49e31..59cb059bfb2d 100644 --- a/packages/react/src/tanstackrouter.ts +++ b/packages/react/src/tanstackrouter.ts @@ -41,7 +41,7 @@ export function tanstackRouterBrowserTracingIntegration( if (instrumentPageLoad && initialWindowLocation) { const matchedRoutes = castRouterInstance.matchRoutes( initialWindowLocation.pathname, - initialWindowLocation.search, + castRouterInstance.options.parseSearch(initialWindowLocation.search), { preload: false, throwOnError: false }, ); diff --git a/packages/react/src/vendor/tanstackrouter-types.ts b/packages/react/src/vendor/tanstackrouter-types.ts index 99a4510228a3..e5eeba71aa87 100644 --- a/packages/react/src/vendor/tanstackrouter-types.ts +++ b/packages/react/src/vendor/tanstackrouter-types.ts @@ -29,6 +29,10 @@ SOFTWARE. export interface VendoredTanstackRouter { history: VendoredTanstackRouterHistory; state: VendoredTanstackRouterState; + options: { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + parseSearch: (search: string) => Record; + }; matchRoutes: ( pathname: string, // eslint-disable-next-line @typescript-eslint/ban-types