Title: @sentry/nextjs v8 does not create issue/error on vercel for API Route Handler · Issue #12045 · getsentry/sentry-javascript · GitHub
Open Graph Title: @sentry/nextjs v8 does not create issue/error on vercel for API Route Handler · Issue #12045 · getsentry/sentry-javascript
X Title: @sentry/nextjs v8 does not create issue/error on vercel for API Route Handler · Issue #12045 · 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/12045
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@sentry/nextjs v8 does not create issue/error on vercel for API Route Handler","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\n8.0.0\n\n### Framework Version\n\nnextjs ^14.2.3\n\n### Link to Sentry event\n\n_No response_\n\n### SDK Setup\n\n```\r\n// My setup is in src/instrumentation.ts\r\nimport * as Sentry from '@sentry/nextjs'\r\nexport async function register() {\r\n \r\n const SENTRY_DSN = process.env.SENTRY_DSN ?? process.env.NEXT_PUBLIC_SENTRY_DSN\r\n console.log('🚀 ~ register ~ register:', SENTRY_DSN)\r\n Sentry.init({\r\n dsn: \"https://aaabbbccc@dddeeerrr.ingest.us.sentry.io/somenumber\",\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 // uncomment the line below to enable Spotlight (https://spotlightjs.com)\r\n // spotlight: process.env.NODE_ENV === 'development',\r\n })\r\n}\r\n\r\n```\r\n\r\n\r\nmy nextjs config\r\n\r\n```\r\nconst { withSentryConfig } = require(\"@sentry/nextjs\");\r\n/** @type {import('next').NextConfig} */\r\nconst nextConfig = {\r\n images : {\r\n // my nextjs config...\r\n } \r\n}\r\n\r\nmodule.exports = withSentryConfig(\r\n nextConfig,\r\n {\r\n org: \"my-org\",\r\n project: \"my-project\",\r\n\r\n authToken: process.env.SENTRY_AUTH_TOKEN,\r\n \r\n }\r\n);\r\n```\r\n\r\n```\r\n // src/app/api/sentry-example-api/route.ts\r\nimport { NextResponse, NextRequest } from \"next/server\";\r\n\r\nexport const dynamic = \"force-dynamic\";\r\n\r\n// A faulty API route to test Sentry's error monitoring\r\n\r\nexport async function GET(request: NextRequest, response: NextResponse) {\r\n \r\n throw new Error(\"Sentry Example API Route Error\");\r\n return NextResponse.json({ data: \"Testing Sentry Error...\" });\r\n}\r\n\r\n```\r\n\n\n### Steps to Reproduce\n\nWhen i visit /api/sentry-example-api on localhost I see the error is tracked correctly in my sentry's dashboard's issues\r\n\r\nHowever when I deployed the code to vercel cloud, I checked that the source map is uploaded correctly, the env variable for dsn, auth_token, all setup correctly (via console.log())\r\n\r\nStep to reproduce:\r\n- When I visited the `/api/sentry-example-api` I saw the page show 500 error, checked vercel log, it does thow the error\r\n- But I cannot see the error show up in sentry's issue dashboard\r\n\r\n\r\n\r\n\r\nAll work well in local env.\r\n\r\nAnd strange thing is the client code for tracking error is working, meaning this page (see screenshot)\r\n\r\n\r\nAny idea?\r\n\n\n### Expected Result\n\nThe error for API route should show up in sentry dashboard\n\n### Actual Result\n\nRight now the error does not show up in sentry dashboard\r\n\r\n\r\n\r\n\r\n\r\n","author":{"url":"https://github.com/TuanManhCao","@type":"Person","name":"TuanManhCao"},"datePublished":"2024-05-15T12:32:00Z","url":"https://github.com/getsentry/sentry-javascript/issues/12045"}
| 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:31697edd-0dea-1c97-71ba-44e584fc9584 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8A44:1C5C1D:1314F9B:19280DB:6B040758 |
| html-safe-nonce | 5360969366afd41fe7bdadc5fe404f78e1f67124be83f4d0672bbb0aa74fe3c5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTQ0OjFDNUMxRDoxMzE0RjlCOjE5MjgwREI6NkIwNDA3NTgiLCJ2aXNpdG9yX2lkIjoiMjYwNzE0MTA4Mjg1Njk0OTU5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5df647f99ffe76155942ad60be0656438027c1b361583bcb06afb6692039355d |
| hovercard-subject-tag | issue:2297786093 |
| 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/12045/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c701a2de24b0320e1b9385677f759bbb8fc0a4bb3e21e5fe67c02da56f1bc4e4/getsentry/sentry-javascript/issues/12045 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c701a2de24b0320e1b9385677f759bbb8fc0a4bb3e21e5fe67c02da56f1bc4e4/getsentry/sentry-javascript/issues/12045 |
| 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 | TuanManhCao |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | canary-2 |
| 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