Skip to content

Commit 1921888

Browse files
lforstAbhiPrasad
andauthored
fix(nextjs): Fix faulty import in Next.js .d.ts (#7175)
Co-authored-by: Abhijeet Prasad <[email protected]>
1 parent a993786 commit 1921888

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

packages/e2e-tests/test-applications/create-next-app/sentry.server.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Sentry.init({
1818
// Note: if you want to override the automatic release value, do not set a
1919
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
2020
// that it will also get attached to your source maps
21+
22+
integrations: [new Sentry.Integrations.LocalVariables()],
2123
});
2224

2325
Sentry.addGlobalEventProcessor(event => {

packages/nextjs/src/index.types.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,19 @@ export * from './edge';
99

1010
import type { Integration, Options, StackParser } from '@sentry/types';
1111

12-
import type { BrowserOptions } from './client';
13-
import * as clientSdk from './client';
14-
import type { EdgeOptions } from './edge';
15-
import * as edgeSdk from './edge';
16-
import type { NodeOptions } from './server';
17-
import * as serverSdk from './server';
12+
import type * as clientSdk from './client';
13+
import type * as edgeSdk from './edge';
14+
import type * as serverSdk from './server';
1815

1916
/** Initializes Sentry Next.js SDK */
20-
export declare function init(options: Options | BrowserOptions | NodeOptions | EdgeOptions): void;
17+
export declare function init(
18+
options: Options | clientSdk.BrowserOptions | serverSdk.NodeOptions | edgeSdk.EdgeOptions,
19+
): void;
2120

2221
// We export a merged Integrations object so that users can (at least typing-wise) use all integrations everywhere.
23-
export const Integrations = { ...clientSdk.Integrations, ...serverSdk.Integrations, ...edgeSdk.Integrations };
22+
export declare const Integrations: typeof clientSdk.Integrations &
23+
typeof serverSdk.Integrations &
24+
typeof edgeSdk.Integrations;
2425

2526
export declare const defaultIntegrations: Integration[];
2627
export declare const defaultStackParser: StackParser;

0 commit comments

Comments
 (0)