Skip to content

Commit

Permalink
fix it
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Feb 5, 2025
1 parent 2d1d38b commit 514ca96
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/browser/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,15 @@ declare const __SENTRY_RELEASE__: string | undefined;
export function init(browserOptions: BrowserOptions = {}): Client | undefined {
const options = applyDefaultOptions(browserOptions);

if (DEBUG_BUILD && !options.skipBrowserExtensionCheck && shouldShowBrowserExtensionError()) {
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.error(
'[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
);
});
if (!options.skipBrowserExtensionCheck && shouldShowBrowserExtensionError()) {
if (DEBUG_BUILD) {
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.error(
'[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
);
});
}
return;
}

Expand Down

0 comments on commit 514ca96

Please sign in to comment.