Skip to content

Commit 9b58519

Browse files
onurtemizkanLms24
andauthored
fix(remix): Add explicit @sentry/node exports. (#8509)
Fix wildcard from node export being incorrectly bundled to the `default` property of @sentry/remix in ESM builds Co-authored-by: Lukas Stracke <[email protected]>
1 parent f0afc37 commit 9b58519

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

packages/remix/src/index.server.ts

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,56 @@ import { instrumentServer } from './utils/instrumentServer';
66
import { buildMetadata } from './utils/metadata';
77
import type { RemixOptions } from './utils/remixOptions';
88

9+
// We need to explicitly export @sentry/node as they end up under `default` in ESM builds
10+
// See: https://github.com/getsentry/sentry-javascript/issues/8474
11+
export {
12+
addGlobalEventProcessor,
13+
addBreadcrumb,
14+
captureCheckIn,
15+
captureException,
16+
captureEvent,
17+
captureMessage,
18+
configureScope,
19+
createTransport,
20+
extractTraceparentData,
21+
getActiveTransaction,
22+
getHubFromCarrier,
23+
getCurrentHub,
24+
Hub,
25+
makeMain,
26+
Scope,
27+
startTransaction,
28+
SDK_VERSION,
29+
setContext,
30+
setExtra,
31+
setExtras,
32+
setTag,
33+
setTags,
34+
setUser,
35+
spanStatusfromHttpCode,
36+
trace,
37+
withScope,
38+
autoDiscoverNodePerformanceMonitoringIntegrations,
39+
makeNodeTransport,
40+
defaultIntegrations,
41+
defaultStackParser,
42+
lastEventId,
43+
flush,
44+
close,
45+
getSentryRelease,
46+
addRequestDataToEvent,
47+
DEFAULT_USER_INCLUDES,
48+
extractRequestData,
49+
deepReadDirSync,
50+
Integrations,
51+
Handlers,
52+
} from '@sentry/node';
53+
54+
// Keeping the `*` exports for backwards compatibility and types
55+
export * from '@sentry/node';
56+
957
export { ErrorBoundary, withErrorBoundary } from '@sentry/react';
1058
export { remixRouterInstrumentation, withSentry } from './performance/client';
11-
export * from '@sentry/node';
1259
export { wrapExpressCreateRequestHandler } from './utils/serverAdapters/express';
1360

1461
function sdkAlreadyInitialized(): boolean {

0 commit comments

Comments
 (0)