11import type { Hub , Scope , Span , SpanTimeInput , StartSpanOptions , TransactionContext } from '@sentry/types' ;
22
33import { dropUndefinedKeys , logger , tracingContextFromHeaders } from '@sentry/utils' ;
4-
54import { getCurrentScope , getIsolationScope , withScope } from '../currentScopes' ;
65
76import { DEBUG_BUILD } from '../debug-build' ;
@@ -10,6 +9,7 @@ import { handleCallbackErrors } from '../utils/handleCallbackErrors';
109import { hasTracingEnabled } from '../utils/hasTracingEnabled' ;
1110import { spanIsSampled , spanTimeInputToSeconds , spanToJSON } from '../utils/spanUtils' ;
1211import { getDynamicSamplingContextFromSpan } from './dynamicSamplingContext' ;
12+ import type { SentrySpan } from './sentrySpan' ;
1313import { addChildSpanToSpan , getActiveSpan , setCapturedScopesOnSpan } from './utils' ;
1414
1515/**
@@ -30,7 +30,7 @@ export function startSpan<T>(context: StartSpanOptions, callback: (span: Span |
3030 // eslint-disable-next-line deprecation/deprecation
3131 const hub = getCurrentHub ( ) ;
3232 // eslint-disable-next-line deprecation/deprecation
33- const parentSpan = scope . getSpan ( ) ;
33+ const parentSpan = scope . getSpan ( ) as SentrySpan | undefined ;
3434
3535 const shouldSkipSpan = context . onlyIfParent && ! parentSpan ;
3636 const activeSpan = shouldSkipSpan
@@ -79,7 +79,7 @@ export function startSpanManual<T>(
7979 // eslint-disable-next-line deprecation/deprecation
8080 const hub = getCurrentHub ( ) ;
8181 // eslint-disable-next-line deprecation/deprecation
82- const parentSpan = scope . getSpan ( ) ;
82+ const parentSpan = scope . getSpan ( ) as SentrySpan | undefined ;
8383
8484 const shouldSkipSpan = context . onlyIfParent && ! parentSpan ;
8585 const activeSpan = shouldSkipSpan
@@ -130,8 +130,8 @@ export function startInactiveSpan(context: StartSpanOptions): Span | undefined {
130130 const hub = getCurrentHub ( ) ;
131131 const parentSpan = context . scope
132132 ? // eslint-disable-next-line deprecation/deprecation
133- context . scope . getSpan ( )
134- : getActiveSpan ( ) ;
133+ ( context . scope . getSpan ( ) as SentrySpan | undefined )
134+ : ( getActiveSpan ( ) as SentrySpan | undefined ) ;
135135
136136 const shouldSkipSpan = context . onlyIfParent && ! parentSpan ;
137137
@@ -264,7 +264,7 @@ function createChildSpanOrTransaction(
264264 forceTransaction,
265265 scope,
266266 } : {
267- parentSpan : Span | undefined ;
267+ parentSpan : SentrySpan | undefined ;
268268 spanContext : TransactionContext ;
269269 forceTransaction ?: boolean ;
270270 scope : Scope ;
0 commit comments