Skip to content

Commit ad3547d

Browse files
authored
fix(nextjs): Make withSentryConfig isomorphic (#8166)
1 parent 6be4e13 commit ad3547d

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

packages/nextjs/src/client/index.ts

+7
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ function addClientIntegrations(options: BrowserOptions): void {
123123
options.integrations = integrations;
124124
}
125125

126+
/**
127+
* Just a passthrough in case this is imported from the client.
128+
*/
129+
export function withSentryConfig<T>(exportedUserNextConfig: T): T {
130+
return exportedUserNextConfig;
131+
}
132+
126133
export {
127134
// eslint-disable-next-line deprecation/deprecation
128135
withSentryServerSideGetInitialProps,

packages/nextjs/src/edge/index.ts

+7
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ export function lastEventId(): string | undefined {
126126
return getCurrentHub().lastEventId();
127127
}
128128

129+
/**
130+
* Just a passthrough in case this is imported from the client.
131+
*/
132+
export function withSentryConfig<T>(exportedUserNextConfig: T): T {
133+
return exportedUserNextConfig;
134+
}
135+
129136
export { flush } from './utils/flush';
130137

131138
export * from '@sentry/core';

packages/nextjs/src/index.types.ts

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ export declare const withErrorBoundary: typeof clientSdk.withErrorBoundary;
3939
export declare const Span: typeof edgeSdk.Span;
4040
export declare const Transaction: typeof edgeSdk.Transaction;
4141

42+
export { withSentryConfig } from './config';
43+
4244
/**
4345
* @deprecated Use `wrapApiHandlerWithSentry` instead
4446
*/

0 commit comments

Comments
 (0)