From b3a047cae2d28f11a404cfe92606415b9bc4acbd Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Mon, 19 Dec 2022 11:55:06 +0100 Subject: [PATCH] fix(nextjs): Export Replay from `index.server.ts` to avoid build error --- packages/nextjs/src/index.server.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/nextjs/src/index.server.ts b/packages/nextjs/src/index.server.ts index ca36e41a0427..19ca5dd26122 100644 --- a/packages/nextjs/src/index.server.ts +++ b/packages/nextjs/src/index.server.ts @@ -15,6 +15,11 @@ import { addOrUpdateIntegration, IntegrationWithExclusionOption } from './utils/ export * from '@sentry/node'; export { captureUnderscoreErrorException } from './utils/_error'; +// Exporting the Replay integration also from index.server.ts because TS only recognizes types from index.server.ts +// If we didn't export this, TS would complain that it can't find `Sentry.Replay` in the package, +// causing a build failure, when users initialize Replay in their sentry.client.config.js/ts file. +export { Replay } from './index.client'; + // Here we want to make sure to only include what doesn't have browser specifics // because or SSR of next.js we can only use this. export { ErrorBoundary, showReportDialog, withErrorBoundary } from '@sentry/react';