Title: `captureException` not working in Next.js/Vercel Edge Runtime · Issue #9626 · getsentry/sentry-javascript · GitHub
Open Graph Title: `captureException` not working in Next.js/Vercel Edge Runtime · Issue #9626 · getsentry/sentry-javascript
X Title: `captureException` not working in Next.js/Vercel Edge Runtime · Issue #9626 · 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/9626
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`captureException` not working in Next.js/Vercel Edge Runtime","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/nextjs\n\n### SDK Version\n\n7.81.1\n\n### Framework Version\n\nNext.js 14.0.3 + React 18\n\n### Link to Sentry event\n\n_No response_\n\n### SDK Setup\n\n`sentry.edge.config.ts`\r\n\r\n```javascript\r\nSentry.init({\r\n dsn: SENTRY_DSN,\r\n\r\n // Adjust this value in production, or use tracesSampler for greater control\r\n tracesSampleRate: 1,\r\n\r\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\r\n debug: false,\r\n});\r\n```\r\n\r\n`sentry.server.config.ts`\r\n\r\n```javascript\r\nSentry.init({\r\n dsn: SENTRY_DSN,\r\n\r\n // Adjust this value in production, or use tracesSampler for greater control\r\n tracesSampleRate: 1,\r\n\r\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\r\n debug: false,\r\n});\r\n```\n\n### Steps to Reproduce\n\n1. On an Edge Runtime that responses with a `ReadableStream`.\r\n2. Call `captureException()` _after_ a promise.\n\n### Expected Result\n\nExceptions should be captured whatever the environment _and_ the response type.\n\n### Actual Result\n\nThe exception is never captured to Sentry's dashboard.\r\n\r\n---\r\n\r\nWhen using [Data Streaming](https://vercel.com/docs/functions/streaming/quickstart) from Next.js and [Vercel](https://vercel.com/docs/functions/streaming) in an Edge Runtime, it seems impossible to capture anything to Sentry _after_ a promise is called. This bug isn't reproducible in NodeJS Runtime.\r\n\r\nYou can find a reproduction with instructions on setup here: https://github.com/roch-numbered/nextjs-stream","author":{"url":"https://github.com/roch-numbered","@type":"Person","name":"roch-numbered"},"datePublished":"2023-11-21T17:00:47Z","url":"https://github.com/getsentry/sentry-javascript/issues/9626"}
| 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:b06c4c65-f0fa-f929-998b-47a3f0af684a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8BE6:D26F7:34DC052:4468910:6B0426E2 |
| html-safe-nonce | 4e23a3cbbd8f1cd2f8a6dca4352d1c8421d6f8371f2604fab964b8cf95201216 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QkU2OkQyNkY3OjM0REMwNTI6NDQ2ODkxMDo2QjA0MjZFMiIsInZpc2l0b3JfaWQiOiI0MDU5MDkzNTQ3OTM5NTM4NjU4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 094e1a1e3124a7fa4aa2371b94f54744ec8e71e027e7b7fc8feba6121a02a0b0 |
| hovercard-subject-tag | issue:2004758256 |
| 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/9626/issue_layout |
| twitter:image | https://opengraph.githubassets.com/914f27ba3906a9985691980f0dfa361739777b7f56f4700f79f699968d0c32c6/getsentry/sentry-javascript/issues/9626 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/914f27ba3906a9985691980f0dfa361739777b7f56f4700f79f699968d0c32c6/getsentry/sentry-javascript/issues/9626 |
| 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 | roch-numbered |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| 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 | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| 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