Skip to content

Commit fd8b0f1

Browse files
committed
fix(nextjs): Export Replay from index.server.ts to avoid build error
1 parent 2fa11eb commit fd8b0f1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

packages/nextjs/src/index.server.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ import { addOrUpdateIntegration, IntegrationWithExclusionOption } from './utils/
1515
export * from '@sentry/node';
1616
export { captureUnderscoreErrorException } from './utils/_error';
1717

18+
// Exporting the Replay integration also from index.server.ts because TS only recognizes types from index.server.ts
19+
// If we didn't export this, TS would complain that it can't find `Sentry.Replay` in the package,
20+
// causing a build failure, when users initialize Replay in their sentry.client.config.js/ts file.
21+
export { Replay } from './index.client';
22+
1823
// Here we want to make sure to only include what doesn't have browser specifics
1924
// because or SSR of next.js we can only use this.
2025
export { ErrorBoundary, showReportDialog, withErrorBoundary } from '@sentry/react';

packages/replay/src/replay.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import { createBreadcrumb } from './util/createBreadcrumb';
4545
import { createPayload } from './util/createPayload';
4646
import { createPerformanceSpans } from './util/createPerformanceSpans';
4747
import { createReplayEnvelope } from './util/createReplayEnvelope';
48+
// import { debounce } from './util/debounce';
4849
import { getReplayEvent } from './util/getReplayEvent';
4950
import { isExpired } from './util/isExpired';
5051
import { isSessionExpired } from './util/isSessionExpired';

0 commit comments

Comments
 (0)