Title: Crash with Vercel AI SDK when used in ESM · Issue #16137 · getsentry/sentry-javascript · GitHub
Open Graph Title: Crash with Vercel AI SDK when used in ESM · Issue #16137 · getsentry/sentry-javascript
X Title: Crash with Vercel AI SDK when used in ESM · Issue #16137 · 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/16137
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash with Vercel AI SDK when used in ESM","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/node\n\n### SDK Version\n\n9.14.0\n\n### Framework Version\n\n_No response_\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\nhttps://github.com/Jaakkonen/sentry-spotlight-vercel-ai-bug\n\n### Steps to Reproduce\n\n1. Create a new Node.js project\n2. Install the required dependencies:\n ```\n npm install @sentry/node ai\n ```\n3. Create the following files:\n ```javascript\n // index.js\n import * as Sentry from '@sentry/node'\n\n Sentry.init({\n tracesSampler: (ctx) => {\n return 0.01\n },\n spotlight: true,\n })\n\n await import(\"./otherfile.js\")\n ```\n ```javascript\n // otherfile.js\n import { generateText } from \"ai\";\n\n console.log(generateText)\n ```\n\n4. Run the application with:\n ```\n $ node index.js\n ```\n\n\n### Expected Result\n\nCode to not crash. With spotlight disabled the code runs fine\n```\n[AsyncFunction: generateText]\n```\n\n### Actual Result\n\n```\n❯ node index.js\nTypeError: setters.get(...)[name] is not a function\n at Object.set (/home/jaakko/Code/opentelemetryairepro/node_modules/.pnpm/import-in-the-middle@1.13.1/node_modules/import-in-the-middle/lib/register.js:13:37)\n at callHookFn (/home/jaakko/Code/opentelemetryairepro/node_modules/.pnpm/import-in-the-middle@1.13.1/node_modules/import-in-the-middle/index.js:31:23)\n at Hook._iitmHook (/home/jaakko/Code/opentelemetryairepro/node_modules/.pnpm/import-in-the-middle@1.13.1/node_modules/import-in-the-middle/index.js:150:11)\n at /home/jaakko/Code/opentelemetryairepro/node_modules/.pnpm/import-in-the-middle@1.13.1/node_modules/import-in-the-middle/lib/register.js:42:31\n at Array.forEach (\u003canonymous>)\n at register (/home/jaakko/Code/opentelemetryairepro/node_modules/.pnpm/import-in-the-middle@1.13.1/node_modules/import-in-the-middle/lib/register.js:42:15)\n at file:///home/jaakko/Code/opentelemetryairepro/node_modules/.pnpm/ai@4.3.10_react@19.1.0_zod@3.24.3/node_modules/ai/dist/index.mjs?iitm=true:1075:1\n at ModuleJob.run (node:internal/modules/esm/module_job:271:25)\n at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:578:26)\n at async file:///home/jaakko/Code/opentelemetryairepro/index.js:10:1\n```","author":{"url":"https://github.com/Jaakkonen","@type":"Person","name":"Jaakkonen"},"datePublished":"2025-04-25T21:54:47Z","url":"https://github.com/getsentry/sentry-javascript/issues/16137"}
| 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:ec2c47f2-1ad3-d6dd-9814-7aa9c4140b84 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BE32:C39E7:70D34:9697E:6B073649 |
| html-safe-nonce | 402e8728d5cbd982030b01c6b78d2fd60fda6d8382b109f0dd060bc36f34dbed |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTMyOkMzOUU3OjcwRDM0Ojk2OTdFOjZCMDczNjQ5IiwidmlzaXRvcl9pZCI6IjMwOTQ3MjA1NTc4NzE0NzgzNDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 38f4aa183af77dde2c2288d0b1584abdb60ea1f5fc73a7cd380dbf111bec44a7 |
| hovercard-subject-tag | issue:3021103541 |
| 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/16137/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b180d71e9c01dfa08775af82d96a8f7f2e72a6617ea69e818e59e0e1206ca8f9/getsentry/sentry-javascript/issues/16137 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b180d71e9c01dfa08775af82d96a8f7f2e72a6617ea69e818e59e0e1206ca8f9/getsentry/sentry-javascript/issues/16137 |
| 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 | Jaakkonen |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2a60952cad7efb2604ea85e500208f51c1ec1943aa260ac605c13eb46a1ed83b |
| 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 | 345c27626db08417fdfc84278a4415ae9a48d8f3 |
| 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