Skip to content

Commit 7ba1bf8

Browse files
feat(nextjs): Export common shims for server and edge nextjs modules
Export common shims (BrowserTracing, Feedback, Replay) to improve DX by: - logging error when server/edge SDK inits invoke client only modules - avoiding compilation warnings for uninvoked client only configuration Fixes GH-9796
1 parent 93bbeb7 commit 7ba1bf8

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

packages/nextjs/src/edge/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import type { SdkMetadata } from '@sentry/types';
44
import { GLOBAL_OBJ, addOrUpdateIntegration, escapeStringForRegex } from '@sentry/utils';
55
import type { VercelEdgeOptions } from '@sentry/vercel-edge';
66
import { init as vercelEdgeInit } from '@sentry/vercel-edge';
7+
// This is exported to warn when server/edge SDK inits invoke client only modules and to avoid compilation warnings for uninvoked client only configuration
8+
export { BrowserTracing, Feedback, Replay } from '@sentry-internal/integration-shims';
79

810
import { isBuild } from '../common/utils/isBuild';
911

packages/nextjs/src/index.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export * from './client';
77
export * from './server';
88
export * from './edge';
99

10+
export type { BrowserTracing, Feedback, Replay } from '@sentry/react';
1011
import type { Integration, Options, StackParser } from '@sentry/types';
1112

1213
import type * as clientSdk from './client';

packages/nextjs/src/server/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { Integrations, configureScope, getCurrentHub, init as nodeInit } from '@
66
import type { EventProcessor } from '@sentry/types';
77
import type { IntegrationWithExclusionOption } from '@sentry/utils';
88
import { addOrUpdateIntegration, escapeStringForRegex, logger } from '@sentry/utils';
9+
// This is exported to warn when server/edge SDK inits invoke client only modules and to avoid compilation warnings for uninvoked client only configuration
10+
export { BrowserTracing, Feedback, Replay } from '@sentry-internal/integration-shims';
911

1012
import { DEBUG_BUILD } from '../common/debug-build';
1113
import { devErrorSymbolicationEventProcessor } from '../common/devErrorSymbolicationEventProcessor';

0 commit comments

Comments
 (0)