Title: @sentry/nextjs not reporting errors from API (serverless) endpoints in Vercel · Issue #3917 · getsentry/sentry-javascript · GitHub
Open Graph Title: @sentry/nextjs not reporting errors from API (serverless) endpoints in Vercel · Issue #3917 · getsentry/sentry-javascript
X Title: @sentry/nextjs not reporting errors from API (serverless) endpoints in Vercel · Issue #3917 · getsentry/sentry-javascript
Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javascript/releases Provide a link to the aff...
Open Graph Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...
X Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/3917
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@sentry/nextjs not reporting errors from API (serverless) endpoints in Vercel","articleBody":"\u003c!-- Requirements: please go through this checklist before opening a new issue -->\r\n\r\n- [x] Review the documentation: https://docs.sentry.io/\r\n- [x] Search for existing issues: https://github.com/getsentry/sentry-javascript/issues\r\n- [x] Use the latest release: https://github.com/getsentry/sentry-javascript/releases\r\n- [ ] Provide a link to the affected event from your Sentry account\r\n\r\n## Package + Version\r\n\r\n- [x] `@sentry/nextjs`\r\n\r\n### Version:\r\n\r\n```\r\n6.11.0\r\n```\r\n\r\n## Description\r\n\r\nI was unable to get error reporting from API endpoints deployed in Vercel (as serverless functions) with `@sentry/nextjs` version 6.11.0 but downgrading to 6.4.1 fixed in.\r\n\r\nOur app is a new one built with Next.js 11.1 from `create-next-app` as of last week.\r\n\r\nWe used the latest `@sentry/nextjs` configured according to the documentation, and with additional changes following the [with-sentry example](https://github.com/vercel/next.js/tree/canary/examples/with-sentry): specifically, added *_error.js* page and `err` pass through to `\u003cComponent/>` in *_app.js*.\r\n\r\nBefore downgrading, client errors were logged fine but I couldn't get error reports from Vercel serverless functions at all.\r\nBoth client- and server-side errors were logged successfully to Sentry when running the project locally with `yarn dev`.\r\n\r\nThis is the failing API endpoint I used to test in file *pages/api/boom.js*:\r\n```js\r\nimport { withSentry } from \"@sentry/nextjs\";\r\n\r\nconst handler = async function handler(req, res) {\r\n // Trigger an exception\r\n boom();\r\n\r\n res.status(200).send(\"OK\");\r\n};\r\n\r\nexport default withSentry(handler);\r\n```\r\n\r\nThe problem seems similar to other reported issues:\r\n- https://github.com/getsentry/sentry-javascript/issues/3643 (closed at time of writing, otherwise I would have commented there instead)\r\n- https://github.com/getsentry/sentry-javascript/issues/3869 (open at time of writing; seemingly fixed, but does not mention API routes)","author":{"url":"https://github.com/jmurty","@type":"Person","name":"jmurty"},"datePublished":"2021-08-24T01:19:57Z","url":"https://github.com/getsentry/sentry-javascript/issues/3917"}
| 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:240385d9-dd4c-ef69-5b8c-d09ff7c55a44 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B21C:3551E1:4180E9:5B0D77:6B0441E6 |
| html-safe-nonce | 494e03773f9b2ace05d3ef55209d89a132fba859e16ac9cc8de740c24b36e939 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjFDOjM1NTFFMTo0MTgwRTk6NUIwRDc3OjZCMDQ0MUU2IiwidmlzaXRvcl9pZCI6Ijc5NTUxMjk5NDkxODExOTg4MjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d2ba23b4fc6f75b7afff4e688f8bbce200948b82e6e6b45bfe4114c6434b564a |
| hovercard-subject-tag | issue:977609501 |
| 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/3917/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d40448e531200982aeff484bf836785a16454d0db0d54bf36eaa40b9cd81f074/getsentry/sentry-javascript/issues/3917 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d40448e531200982aeff484bf836785a16454d0db0d54bf36eaa40b9cd81f074/getsentry/sentry-javascript/issues/3917 |
| og:image:alt | Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jmurty |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64 |
| 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 | 06dc448a76fe4751ac1db26524aefa3aa3e889a8 |
| 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