Skip to content

Commit 38bf328

Browse files
committed
Fix manifest fallback to set scope transaction name without activeRootSpan, remove dead type
1 parent a779e04 commit 38bf328

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/react/src/reactrouter-compat-utils/instrumentation.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ function updatePageloadTransaction({
982982
activeRootSpan.updateName(name);
983983
activeRootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, source);
984984
}
985-
} else if (activeRootSpan && _enableAsyncRouteHandlers && _lazyRouteManifest && _lazyRouteManifest.length > 0) {
985+
} else if (_enableAsyncRouteHandlers && _lazyRouteManifest && _lazyRouteManifest.length > 0) {
986986
// No matching branches yet -- fall back to manifest for parameterized name.
987987
const [name, source] = resolveRouteNameAndSource(
988988
location,
@@ -996,8 +996,11 @@ function updatePageloadTransaction({
996996

997997
if (source === 'route') {
998998
getCurrentScope().setTransactionName(name || '/');
999-
activeRootSpan.updateName(name);
1000-
activeRootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, source);
999+
1000+
if (activeRootSpan) {
1001+
activeRootSpan.updateName(name);
1002+
activeRootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, source);
1003+
}
10011004
}
10021005
}
10031006
}

packages/react/src/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ export interface AgnosticRouteMatch<
128128
route: RouteObjectType;
129129
}
130130

131-
export type AgnosticDataRouteMatch = AgnosticRouteMatch<string, AgnosticDataRouteObject>;
132-
133131
interface UseMatchesMatch {
134132
id: string;
135133
pathname: string;

0 commit comments

Comments
 (0)