Skip to content

Commit cae14ab

Browse files
committed
ref(browser): Skip browser extension warning in non-debug builds
I think it is fair to exclude this here, saving a few bytes...?
1 parent 2780c3c commit cae14ab

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

packages/browser/src/sdk.ts

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

175-
if (!options.skipBrowserExtensionCheck && shouldShowBrowserExtensionError()) {
175+
if (DEBUG_BUILD && !options.skipBrowserExtensionCheck && shouldShowBrowserExtensionError()) {
176176
consoleSandbox(() => {
177177
// eslint-disable-next-line no-console
178178
console.error(
@@ -182,12 +182,10 @@ export function init(browserOptions: BrowserOptions = {}): Client | undefined {
182182
return;
183183
}
184184

185-
if (DEBUG_BUILD) {
186-
if (!supportsFetch()) {
187-
logger.warn(
188-
'No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill.',
189-
);
190-
}
185+
if (DEBUG_BUILD && !supportsFetch()) {
186+
logger.warn(
187+
'No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill.',
188+
);
191189
}
192190
const clientOptions: BrowserClientOptions = {
193191
...options,

0 commit comments

Comments
 (0)