Skip to content

Commit 514ca96

Browse files
committed
fix it
1 parent 2d1d38b commit 514ca96

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

packages/browser/src/sdk.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,15 @@ declare const __SENTRY_RELEASE__: string | undefined;
172172
export function init(browserOptions: BrowserOptions = {}): Client | undefined {
173173
const options = applyDefaultOptions(browserOptions);
174174

175-
if (DEBUG_BUILD && !options.skipBrowserExtensionCheck && shouldShowBrowserExtensionError()) {
176-
consoleSandbox(() => {
177-
// eslint-disable-next-line no-console
178-
console.error(
179-
'[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
180-
);
181-
});
175+
if (!options.skipBrowserExtensionCheck && shouldShowBrowserExtensionError()) {
176+
if (DEBUG_BUILD) {
177+
consoleSandbox(() => {
178+
// eslint-disable-next-line no-console
179+
console.error(
180+
'[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
181+
);
182+
});
183+
}
182184
return;
183185
}
184186

0 commit comments

Comments
 (0)