From 84459aaff732e65a059be445e1b07e4aaf79dc60 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Thu, 7 Dec 2023 13:42:11 +0100 Subject: [PATCH] fix(browser): Avoid importing from `./exports` This has a side effect in `@sentry/browser`, so importing from there is not safe. Instead just directly import this from core. --- packages/browser/src/integrations/breadcrumbs.ts | 3 +-- packages/browser/src/profiling/utils.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/browser/src/integrations/breadcrumbs.ts b/packages/browser/src/integrations/breadcrumbs.ts index 1a817cceb5b5..cfcb255f5999 100644 --- a/packages/browser/src/integrations/breadcrumbs.ts +++ b/packages/browser/src/integrations/breadcrumbs.ts @@ -1,5 +1,5 @@ /* eslint-disable max-lines */ -import { getCurrentHub } from '@sentry/core'; +import { getClient, getCurrentHub } from '@sentry/core'; import type { Event as SentryEvent, HandlerDataConsole, @@ -31,7 +31,6 @@ import { } from '@sentry/utils'; import { DEBUG_BUILD } from '../debug-build'; -import { getClient } from '../exports'; import { WINDOW } from '../helpers'; /** JSDoc */ diff --git a/packages/browser/src/profiling/utils.ts b/packages/browser/src/profiling/utils.ts index c7f056868732..1aac3d397ca7 100644 --- a/packages/browser/src/profiling/utils.ts +++ b/packages/browser/src/profiling/utils.ts @@ -1,12 +1,11 @@ /* eslint-disable max-lines */ -import { DEFAULT_ENVIRONMENT, getCurrentHub } from '@sentry/core'; +import { DEFAULT_ENVIRONMENT, getClient, getCurrentHub } from '@sentry/core'; import type { DebugImage, Envelope, Event, StackFrame, StackParser, Transaction } from '@sentry/types'; import type { Profile, ThreadCpuProfile } from '@sentry/types/src/profiling'; import { GLOBAL_OBJ, browserPerformanceTimeOrigin, forEachEnvelopeItem, logger, uuid4 } from '@sentry/utils'; import { DEBUG_BUILD } from '../debug-build'; -import { getClient } from '../exports'; import { WINDOW } from '../helpers'; import type { JSSelfProfile, JSSelfProfileStack, JSSelfProfiler, JSSelfProfilerConstructor } from './jsSelfProfiling';