From 2c08aa14643416a97d6ec04683e3c11277abb2a8 Mon Sep 17 00:00:00 2001 From: Onur Temizkan Date: Wed, 12 Jul 2023 07:19:33 +0100 Subject: [PATCH 1/2] fix(remix): Add explicit `@sentry/node` exports. --- packages/remix/src/index.server.ts | 48 +++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/packages/remix/src/index.server.ts b/packages/remix/src/index.server.ts index 21cfc20b17ab..e7036f4098e5 100644 --- a/packages/remix/src/index.server.ts +++ b/packages/remix/src/index.server.ts @@ -6,9 +6,55 @@ import { instrumentServer } from './utils/instrumentServer'; import { buildMetadata } from './utils/metadata'; import type { RemixOptions } from './utils/remixOptions'; +// We need to explicitly export @sentry/node as they end up under `default` in ESM builds +// See: https://github.com/getsentry/sentry-javascript/issues/8474 +export { + addGlobalEventProcessor, + addBreadcrumb, + captureException, + captureEvent, + captureMessage, + configureScope, + createTransport, + extractTraceparentData, + getActiveTransaction, + getHubFromCarrier, + getCurrentHub, + Hub, + makeMain, + Scope, + startTransaction, + SDK_VERSION, + setContext, + setExtra, + setExtras, + setTag, + setTags, + setUser, + spanStatusfromHttpCode, + trace, + withScope, + autoDiscoverNodePerformanceMonitoringIntegrations, + makeNodeTransport, + defaultIntegrations, + defaultStackParser, + lastEventId, + flush, + close, + getSentryRelease, + addRequestDataToEvent, + DEFAULT_USER_INCLUDES, + extractRequestData, + deepReadDirSync, + Integrations, + Handlers, +} from '@sentry/node'; + +// Keeping the `*` exports for backwards compatibility and types +export * from '@sentry/node'; + export { ErrorBoundary, withErrorBoundary } from '@sentry/react'; export { remixRouterInstrumentation, withSentry } from './performance/client'; -export * from '@sentry/node'; export { wrapExpressCreateRequestHandler } from './utils/serverAdapters/express'; function sdkAlreadyInitialized(): boolean { From d651fe27cf9f5b1f4beb23195fedc51b23a7d4ff Mon Sep 17 00:00:00 2001 From: Onur Temizkan Date: Wed, 12 Jul 2023 09:24:01 +0100 Subject: [PATCH 2/2] Update packages/remix/src/index.server.ts Co-authored-by: Lukas Stracke --- packages/remix/src/index.server.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/remix/src/index.server.ts b/packages/remix/src/index.server.ts index e7036f4098e5..91839a809993 100644 --- a/packages/remix/src/index.server.ts +++ b/packages/remix/src/index.server.ts @@ -11,6 +11,7 @@ import type { RemixOptions } from './utils/remixOptions'; export { addGlobalEventProcessor, addBreadcrumb, + captureCheckIn, captureException, captureEvent, captureMessage,