Skip to content

Commit 7501e60

Browse files
committed
fix(ci): Add NEXT_PUBLIC_SENTRY_SPOTLIGHT env var for E2E tests
The nextjs-15-spotlight test expects NEXT_PUBLIC_SENTRY_SPOTLIGHT to be set, but CI only set VITE_SENTRY_SPOTLIGHT. Adding the Next.js variant so the Spotlight auto-enablement test works in CI. Also fix import to use @sentry/browser directly for spotlightBrowserIntegration to avoid build order issues.
1 parent 1ab6f28 commit 7501e60

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,7 @@ jobs:
930930
VITE_E2E_TEST_DSN: 'https://username@domain/123'
931931
# For Spotlight environment variable tests
932932
VITE_SENTRY_SPOTLIGHT: 'true'
933+
NEXT_PUBLIC_SENTRY_SPOTLIGHT: 'true'
933934
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
934935
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
935936
strategy:
@@ -1066,6 +1067,7 @@ jobs:
10661067
VITE_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
10671068
# For Spotlight environment variable tests
10681069
VITE_SENTRY_SPOTLIGHT: 'true'
1070+
NEXT_PUBLIC_SENTRY_SPOTLIGHT: 'true'
10691071
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
10701072
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
10711073
strategy:
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
/// <reference path="./.next/types/routes.d.ts" />
43

54
// NOTE: This file should not be edited
6-
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

packages/nextjs/src/client/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ import {
1111
GLOBAL_OBJ,
1212
resolveSpotlightOptions,
1313
} from '@sentry/core';
14+
import { spotlightBrowserIntegration } from '@sentry/browser';
1415
import type { BrowserOptions } from '@sentry/react';
15-
import {
16-
getDefaultIntegrations as getReactDefaultIntegrations,
17-
init as reactInit,
18-
spotlightBrowserIntegration,
19-
} from '@sentry/react';
16+
import { getDefaultIntegrations as getReactDefaultIntegrations, init as reactInit } from '@sentry/react';
2017
import { devErrorSymbolicationEventProcessor } from '../common/devErrorSymbolicationEventProcessor';
2118
import { getVercelEnv } from '../common/getVercelEnv';
2219
import { isRedirectNavigationError } from '../common/nextNavigationErrorUtils';

0 commit comments

Comments
 (0)