@@ -7,11 +7,7 @@ import {
77
88import { browserTracingIntegration as originalBrowserTracingIntegration } from '@sentry/browser' ;
99import type { Integration } from '@sentry/types' ;
10- import type {
11- VendoredTanstackRouter ,
12- VendoredTanstackRouterLocation ,
13- VendoredTanstackRouterRouteMatch ,
14- } from './vendor/tanstackrouter-types' ;
10+ import type { VendoredTanstackRouter , VendoredTanstackRouterRouteMatch } from './vendor/tanstackrouter-types' ;
1511
1612/**
1713 * A custom browser tracing integration for TanStack Router.
@@ -44,10 +40,8 @@ export function tanstackRouterBrowserTracingIntegration(
4440 const initialWindowLocation = WINDOW . location ;
4541 if ( instrumentPageLoad && initialWindowLocation ) {
4642 const matchedRoutes = castRouterInstance . matchRoutes (
47- {
48- pathname : initialWindowLocation . pathname ,
49- search : castRouterInstance . options . parseSearch ( initialWindowLocation . search ) ,
50- } as VendoredTanstackRouterLocation ,
43+ initialWindowLocation . pathname ,
44+ castRouterInstance . options . parseSearch ( initialWindowLocation . search ) ,
5145 { preload : false , throwOnError : false } ,
5246 ) ;
5347
@@ -72,10 +66,11 @@ export function tanstackRouterBrowserTracingIntegration(
7266 return ;
7367 }
7468
75- const onResolvedMatchedRoutes = castRouterInstance . matchRoutes ( onBeforeNavigateArgs . toLocation , {
76- preload : false ,
77- throwOnError : false ,
78- } ) ;
69+ const onResolvedMatchedRoutes = castRouterInstance . matchRoutes (
70+ onBeforeNavigateArgs . toLocation . pathname ,
71+ onBeforeNavigateArgs . toLocation . search ,
72+ { preload : false , throwOnError : false } ,
73+ ) ;
7974
8075 const onBeforeNavigateLastMatch = onResolvedMatchedRoutes [ onResolvedMatchedRoutes . length - 1 ] ;
8176
@@ -93,10 +88,11 @@ export function tanstackRouterBrowserTracingIntegration(
9388 const unsubscribeOnResolved = castRouterInstance . subscribe ( 'onResolved' , onResolvedArgs => {
9489 unsubscribeOnResolved ( ) ;
9590 if ( navigationSpan ) {
96- const onResolvedMatchedRoutes = castRouterInstance . matchRoutes ( onResolvedArgs . toLocation , {
97- preload : false ,
98- throwOnError : false ,
99- } ) ;
91+ const onResolvedMatchedRoutes = castRouterInstance . matchRoutes (
92+ onResolvedArgs . toLocation . pathname ,
93+ onResolvedArgs . toLocation . search ,
94+ { preload : false , throwOnError : false } ,
95+ ) ;
10096
10197 const onResolvedLastMatch = onResolvedMatchedRoutes [ onResolvedMatchedRoutes . length - 1 ] ;
10298
0 commit comments