Skip to content

Commit

Permalink
fix: don't run browser metrics in worker
Browse files Browse the repository at this point in the history
Minimal fix for getsentry#3934
  • Loading branch information
gthb committed Aug 31, 2021
1 parent 949f1b6 commit 71376fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/tracing/src/browser/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class MetricsInstrumentation {
private _clsEntry: LayoutShift | undefined;

public constructor() {
if (!isNodeEnv() && global?.performance) {
if (!isNodeEnv() && global?.performance && typeof window !== 'undefined') {
if (global.performance.mark) {
global.performance.mark('sentry-tracing-init');
}
Expand Down

0 comments on commit 71376fd

Please sign in to comment.