Title: @sentry/remix doesn't work with Node ESM support · Issue #8474 · getsentry/sentry-javascript · GitHub
Open Graph Title: @sentry/remix doesn't work with Node ESM support · Issue #8474 · getsentry/sentry-javascript
X Title: @sentry/remix doesn't work with Node ESM support · Issue #8474 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/8474
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@sentry/remix doesn't work with Node ESM support","articleBody":"### Is there an existing issue for this?\n\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [X] I have reviewed the documentation https://docs.sentry.io/\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/remix\n\n### SDK Version\n\n7.55.2\n\n### Framework Version\n\n1.18.1\n\n### Link to Sentry event\n\n_No response_\n\n### SDK Setup\n\nThis is reproducible without setup\n\n### Steps to Reproduce\n\nCreate a file:\r\n\r\n```js\r\nimport * as Sentry from \"@sentry/remix\"\r\n\r\nconsole.log(Sentry);\r\n```\r\n\r\nYou would expect the `Sentry` object to contain methods like `captureEvent`\n\n### Expected Result\n\nIt doesn't. The import to `@sentry/node` under the hood fails to pull named exports and instead you get a `default` object under the exports that contains all of the event-capturing methods. This makes the included TypeScript types incorrect and makes a line like\r\n\r\n```ts\r\nSentry.captureException(e);\r\n```\r\n\r\nFail because the method is actually at \r\n\r\n```ts\r\nSentry.default.captureException(e);\r\n```\r\n\r\nBut in a typescript environment, you can't write the latter because the types say that captureEvent is a named export, not nested under a `default` object.\n\n### Actual Result\n\n```\r\n[Module: null prototype] {\r\n ErrorBoundary: [class ErrorBoundary extends Component],\r\n __esModule: true,\r\n default: {\r\n ErrorBoundary: [class ErrorBoundary extends Component],\r\n withErrorBoundary: [Function: withErrorBoundary],\r\n remixRouterInstrumentation: [Function: remixRouterInstrumentation],\r\n withSentry: [Function: withSentry],\r\n wrapExpressCreateRequestHandler: [Function: wrapExpressCreateRequestHandler],\r\n init: [Function: init],\r\n Hub: [class Hub],\r\n SDK_VERSION: '7.55.2',\r\n Scope: [class Scope],\r\n addBreadcrumb: [Function: addBreadcrumb],\r\n addGlobalEventProcessor: [Function: addGlobalEventProcessor],\r\n captureCheckIn: [Function: captureCheckIn],\r\n captureEvent: [Function: captureEvent],\r\n captureException: [Function: captureException],\r\n captureMessage: [Function: captureMessage],\r\n configureScope: [Function: configureScope],\r\n createTransport: [Function: createTransport],\r\n extractTraceparentData: [Function: extractTraceparentData],\r\n getActiveTransaction: [Function: getActiveTransaction],\r\n getCurrentHub: [Function: getCurrentHub],\r\n getHubFromCarrier: [Function: getHubFromCarrier],\r\n makeMain: [Function: makeMain],\r\n runWithAsyncContext: [Function: runWithAsyncContext],\r\n setContext: [Function: setContext],\r\n setExtra: [Function: setExtra],\r\n setExtras: [Function: setExtras],\r\n setTag: [Function: setTag],\r\n setTags: [Function: setTags],\r\n setUser: [Function: setUser],\r\n spanStatusfromHttpCode: [Function: spanStatusfromHttpCode],\r\n startTransaction: [Function: startTransaction],\r\n trace: [Function: trace],\r\n withScope: [Function: withScope],\r\n autoDiscoverNodePerformanceMonitoringIntegrations: [Function: autoDiscoverNodePerformanceMonitoringIntegrations],\r\n NodeClient: [class NodeClient extends BaseClient],\r\n makeNodeTransport: [Function: makeNodeTransport],\r\n close: [AsyncFunction: close],\r\n defaultIntegrations: [\r\n [InboundFilters],\r\n [FunctionToString],\r\n [Console],\r\n [Http],\r\n [Undici],\r\n [OnUncaughtException],\r\n [OnUnhandledRejection],\r\n [ContextLines],\r\n [LocalVariables],\r\n [Context],\r\n [Modules],\r\n [RequestData],\r\n [LinkedErrors]\r\n ],\r\n defaultStackParser: [Function (anonymous)],\r\n flush: [AsyncFunction: flush],\r\n getSentryRelease: [Function: getSentryRelease],\r\n lastEventId: [Function: lastEventId],\r\n DEFAULT_USER_INCLUDES: [ 'id', 'username', 'email' ],\r\n addRequestDataToEvent: [Function: addRequestDataToEvent],\r\n extractRequestData: [Function: extractRequestData],\r\n deepReadDirSync: [Function: deepReadDirSync],\r\n Handlers: {\r\n extractRequestData: [Function: extractRequestData],\r\n parseRequest: [Function: parseRequest],\r\n errorHandler: [Function: errorHandler],\r\n requestHandler: [Function: requestHandler],\r\n tracingHandler: [Function: tracingHandler],\r\n trpcMiddleware: [Function: trpcMiddleware]\r\n },\r\n Integrations: {\r\n FunctionToString: [Function],\r\n InboundFilters: [Function],\r\n Console: [Function],\r\n Http: [Function],\r\n OnUncaughtException: [Function],\r\n OnUnhandledRejection: [Function],\r\n LinkedErrors: [Function],\r\n Modules: [Function],\r\n ContextLines: [Function],\r\n Context: [Function],\r\n RequestData: [Function],\r\n LocalVariables: [Function],\r\n Undici: [Function],\r\n Apollo: [Function],\r\n Express: [Function],\r\n GraphQL: [Function],\r\n Mongo: [Function],\r\n Mysql: [Function],\r\n Postgres: [Function],\r\n Prisma: [Function]\r\n }\r\n },\r\n init: [Function: init],\r\n remixRouterInstrumentation: [Function: remixRouterInstrumentation],\r\n withErrorBoundary: [Function: withErrorBoundary],\r\n withSentry: [Function: withSentry],\r\n wrapExpressCreateRequestHandler: [Function: wrapExpressCreateRequestHandler]\r\n}\r\n```","author":{"url":"https://github.com/tmcw","@type":"Person","name":"tmcw"},"datePublished":"2023-07-07T17:51:29Z","url":"https://github.com/getsentry/sentry-javascript/issues/8474"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:49385a0c-1b12-a69d-ff8f-e81910fb56c1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B8F0:167446:37DBF:4BC1C:6B04A2EC |
| html-safe-nonce | d7c5c414a2f45c1b9524aab1f2efe1d34ccdaafbd3c812c2c02364586b572fec |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOEYwOjE2NzQ0NjozN0RCRjo0QkMxQzo2QjA0QTJFQyIsInZpc2l0b3JfaWQiOiI0NzM3OTc2NzE2MDYzMTg3NjkyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7746f2f46d47e1a1bf605cda755b9414d550b27956097fbf9dc9fc4810616d9e |
| hovercard-subject-tag | issue:1793944740 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/8474/issue_layout |
| twitter:image | https://opengraph.githubassets.com/57f208dbcfc07e138bd87557b277d58c3a05067afcd16235ab2cef7fb60ba67d/getsentry/sentry-javascript/issues/8474 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/57f208dbcfc07e138bd87557b277d58c3a05067afcd16235ab2cef7fb60ba67d/getsentry/sentry-javascript/issues/8474 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tmcw |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9784b6f42e2d5eac4e394fa88cad134c0dc5b6662b4ff2787a1ed1ef5a96331d |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3fd14143b75b2af7b76bbd23b069867d091adfcc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width