Skip to content

Commit 9a9ba91

Browse files
committed
fix(browser): Remove development-only wrapper from Spotlight auto-enablement
The Spotlight auto-enablement code was wrapped in rollup-include-development-only, which stripped it from production builds. But users install production builds of the SDK from npm and still expect auto-enablement to work during their app's development (when they set NEXT_PUBLIC_SENTRY_SPOTLIGHT=true, etc.). The env vars won't be set in production deployments anyway, and users can explicitly disable Spotlight with `spotlight: false` if needed.
1 parent 7c1107f commit 9a9ba91

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/browser/src/sdk.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,12 @@ export function init(options: BrowserOptions = {}): Client | undefined {
9696
let defaultIntegrations =
9797
options.defaultIntegrations == null ? getDefaultIntegrations(options) : options.defaultIntegrations;
9898

99-
/* rollup-include-development-only */
100-
// Resolve Spotlight configuration with proper precedence
99+
// Resolve Spotlight configuration with proper precedence.
100+
// This code is intentionally NOT wrapped in rollup-include-development-only because:
101+
// - Users install production builds of the SDK from npm
102+
// - They expect auto-enablement to work during their app's development
103+
// - The env var (NEXT_PUBLIC_SENTRY_SPOTLIGHT, etc.) won't be set in production deployments
104+
// - Users can explicitly disable with `spotlight: false` if needed
101105
const envSpotlight = getSpotlightConfig();
102106
// resolveSpotlightOptions is the single source of truth that ensures empty strings are never used
103107
const spotlightValue = resolveSpotlightOptions(options.spotlight, envSpotlight);
@@ -109,7 +113,6 @@ export function init(options: BrowserOptions = {}): Client | undefined {
109113
const args = typeof spotlightValue === 'string' ? { sidecarUrl: spotlightValue } : undefined;
110114
defaultIntegrations.push(spotlightBrowserIntegration(args));
111115
}
112-
/* rollup-include-development-only-end */
113116

114117
const clientOptions: BrowserClientOptions = {
115118
...options,

0 commit comments

Comments
 (0)