Skip to content

Commit 315a5db

Browse files
authored
fix(browser): check supportedEntryTypes before caling the function (#13541)
`PerformanceObserver` is available on iOS 11 and later, but the `supportedEntryTypes` method is available on iOS 13 and later. ref: https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver Therefore, a runtime error will occur if we use Sentry on iOS 11 or iOS 12.
1 parent 8eaa562 commit 315a5db

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/browser/src/tracing/browserTracingIntegration.ts

+1
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ export const browserTracingIntegration = ((_options: Partial<BrowserTracingOptio
218218
if (
219219
enableLongAnimationFrame &&
220220
GLOBAL_OBJ.PerformanceObserver &&
221+
PerformanceObserver.supportedEntryTypes &&
221222
PerformanceObserver.supportedEntryTypes.includes('long-animation-frame')
222223
) {
223224
startTrackingLongAnimationFrames();

0 commit comments

Comments
 (0)