Skip to content

Commit abeae3d

Browse files
committed
add type cast
1 parent 6ca89fa commit abeae3d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/core/src/tracing/sampling.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Options, SamplingContext } from '../types-hoist';
1+
import type { Options, RequestEventData, SamplingContext } from '../types-hoist';
22

33
import { getIsolationScope } from '../currentScopes';
44
import { DEBUG_BUILD } from '../debug-build';
@@ -21,7 +21,9 @@ export function sampleSpan(
2121
return [false];
2222
}
2323

24-
const normalizedRequest = getIsolationScope().getScopeData().sdkProcessingMetadata.normalizedRequest;
24+
// Casting this from unknown, as the type of `sdkProcessingMetadata` is only changed in v9 and `normalizedRequest` is set in SentryHttpInstrumentation
25+
const normalizedRequest = getIsolationScope().getScopeData().sdkProcessingMetadata
26+
.normalizedRequest as RequestEventData;
2527

2628
const enhancedSamplingContext = {
2729
...samplingContext,

0 commit comments

Comments
 (0)