Skip to content

Commit 6cbe609

Browse files
committed
fix it
1 parent e0fb856 commit 6cbe609

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/core/src/carrier.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ export function getGlobalSingleton<Prop extends keyof SentryCarrier>(
7474
creator: () => NonNullable<SentryCarrier[Prop]>,
7575
obj = GLOBAL_OBJ,
7676
): NonNullable<SentryCarrier[Prop]> {
77-
const carrier = getSentryCarrier(obj);
77+
const __SENTRY__ = (obj.__SENTRY__ = obj.__SENTRY__ || {});
78+
const carrier = (__SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {});
79+
// Note: We do not want to set `carrier.version` here, as this may be called before any `init` is called, e.g. for the default scopes
7880
return carrier[name] || (carrier[name] = creator());
7981
}

0 commit comments

Comments
 (0)