File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -92,8 +92,12 @@ export function tanstackRouterBrowserTracingIntegration<R extends AnyRouter>(
9292
9393 const navigationLocation = WINDOW . location ;
9494 const navigationSpan = startBrowserTracingNavigationSpan ( client , {
95- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
96- name : onBeforeNavigateLastMatch ? onBeforeNavigateLastMatch . routeId : navigationLocation . pathname ,
95+ name : onBeforeNavigateLastMatch
96+ ? // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
97+ onBeforeNavigateLastMatch . routeId
98+ : // In SSR/non-browser contexts, WINDOW.location may be undefined, so fall back to the router's location
99+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
100+ navigationLocation ?. pathname || onBeforeNavigateArgs . toLocation . pathname ,
97101 attributes : {
98102 [ SEMANTIC_ATTRIBUTE_SENTRY_OP ] : 'navigation' ,
99103 [ SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN ] : 'auto.navigation.vue.tanstack_router' ,
You can’t perform that action at this time.
0 commit comments