Skip to content

Commit f16dd8b

Browse files
committed
fix: don't run browser metrics in worker
Minimal fix for #3934
1 parent 949f1b6 commit f16dd8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/tracing/src/browser/metrics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class MetricsInstrumentation {
2323
private _clsEntry: LayoutShift | undefined;
2424

2525
public constructor() {
26-
if (!isNodeEnv() && global?.performance) {
26+
if (!isNodeEnv() && global?.performance && global?.document) {
2727
if (global.performance.mark) {
2828
global.performance.mark('sentry-tracing-init');
2929
}

0 commit comments

Comments
 (0)