Title: Sveltekit server-side exceptions outside the `handle` hook are not correctly captured in a Vercel deploy · Issue #8855 · getsentry/sentry-javascript · GitHub
Open Graph Title: Sveltekit server-side exceptions outside the `handle` hook are not correctly captured in a Vercel deploy · Issue #8855 · getsentry/sentry-javascript
X Title: Sveltekit server-side exceptions outside the `handle` hook are not correctly captured in a Vercel deploy · Issue #8855 · 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/8855
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Sveltekit server-side exceptions outside the `handle` hook are not correctly captured in a Vercel deploy","articleBody":"### Is there an existing issue for this?\r\n\r\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\r\n- [X] I have reviewed the documentation https://docs.sentry.io/\r\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\r\n\r\n### How do you use Sentry?\r\n\r\nSentry Saas (sentry.io)\r\n\r\n### Which SDK are you using?\r\n\r\n@sentry/sveltekit\r\n\r\n### SDK Version\r\n\r\n7.64.0\r\n\r\n### Framework Version\r\n\r\n1.22.6\r\n\r\n### Link to Sentry event\r\n\r\n_No response_\r\n\r\n### SDK Setup\r\n\r\n```ts\r\nSentry.init({\r\n dsn: \"https://7f6570917828021f8dea53dc2b778775@o1098001.ingest.sentry.io/4505744165699584\",\r\n tracesSampleRate: 1,\r\n environment: PUBLIC_DEPLOY_ENV,\r\n debug: true,\r\n});\r\n```\r\n\r\n### Steps to Reproduce\r\n\r\nI have a Sveltekit project with Sentry set up according to the directions. In local development, everything works as excepted. In a vercel deployment, exception capturing is failing in the following way:\r\n\r\nWhen I capture exceptions manually in a `handle` hook, it works just fine - so sentry has clearly been set up correctly.\r\n\r\nHowever, capturing an exception from anywhere else in the application outside the `handle` hook, or in a manually created `handleError` hook, does not work. Needless to say the `Sentry.handleErrorWithSentry()` default `handleError` hook does not work either.\r\n\r\n### Expected Result\r\n\r\nErrors should show up in the sentry console.\r\n\r\n### Actual Result\r\n\r\nNo server-side errors, either the manually captured error or the error captured in the `handleError` hook are captured. Those captured as a test in the `handle` hook appear just fine.\r\n\r\nHere is a request log from the failing transaction with sentry debug enabled. The code for this endpoint is:\r\n```\r\nexport const GET = async () => {\r\n captureException(new Error(\"Manually captured API Route Error\"));\r\n throw new Error(\"Sentry Example API Route Error\");\r\n};\r\n```\r\n\r\n```\r\nSentry Logger [log]: [Tracing] Adding sentry-trace header 5f26faf8ada34e05ba10d48404f0a80a-8b4ee351a68e3c73-0 to outgoing request to \"http://127.0.0.1:34673/\": \r\nSentry Logger [log]: [Tracing] starting http.server transaction - GET /sentry-example\r\nSentry Logger [log]: [Tracing] Starting 'http.client' span on transaction 'GET /sentry-example' (b3b9f273ae588e38).\r\nSentry Logger [log]: [Tracing] Finishing 'http.client' span on transaction 'GET /sentry-example' (b3b9f273ae588e38).\r\nError: Sentry Example API Route Error\r\n at GET (file:///var/task/vercel/path0/.svelte-kit/output/server/entries/endpoints/sentry-example/_server.js:5:9)\r\n at render_endpoint (file:///var/task/vercel/path0/.svelte-kit/output/server/index.js:218:26)\r\n at resolve (file:///var/task/vercel/path0/.svelte-kit/output/server/index.js:2644:28)\r\n at async /var/task/vercel/path0/node_modules/@sentry/sveltekit/cjs/server/handle.js:112:19\r\nError: Sentry Example API Route Error\r\n at GET (file:///var/task/vercel/path0/.svelte-kit/output/server/entries/endpoints/sentry-example/_server.js:5:9)\r\n at render_endpoint (file:///var/task/vercel/path0/.svelte-kit/output/server/index.js:218:26)\r\n at resolve (file:///var/task/vercel/path0/.svelte-kit/output/server/index.js:2644:28)\r\n at async /var/task/vercel/path0/node_modules/@sentry/sveltekit/cjs/server/handle.js:112:19\r\nSentry Logger [log]: [Tracing] Finishing http.server transaction: GET /sentry-example.\r\n```","author":{"url":"https://github.com/fnimick","@type":"Person","name":"fnimick"},"datePublished":"2023-08-21T21:04:07Z","url":"https://github.com/getsentry/sentry-javascript/issues/8855"}
| 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:1bcaa433-0de0-7ec2-a270-e29387a1dea0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E752:2DFC9:603440:876E79:6B0449DD |
| html-safe-nonce | 498327b7cc04cea04c7b9b07071964da985f132b8c3db1f2b833520acb84e57f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzUyOjJERkM5OjYwMzQ0MDo4NzZFNzk6NkIwNDQ5REQiLCJ2aXNpdG9yX2lkIjoiMTYwMjkyMzM3MTk0NjA2ODQ0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 68c7246063ee56ea0aef99df01d87b10d5a930b64cf8a6964c5577ca43fd6286 |
| hovercard-subject-tag | issue:1860146436 |
| 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/8855/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9109f6bd3fee5888ba07b7fa5bd559bff5b17d22649cb961c7cab18c0c3ab275/getsentry/sentry-javascript/issues/8855 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9109f6bd3fee5888ba07b7fa5bd559bff5b17d22649cb961c7cab18c0c3ab275/getsentry/sentry-javascript/issues/8855 |
| 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 | fnimick |
| hostname | github.com |
| expected-hostname | github.com |
| None | d4495c3631faba668036f176d1f5946901c5172efd73a6edb984029e7d4f8e46 |
| 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 | 9ac4337fb7c6a5846cdfdb1a04f154d3c33ebc77 |
| 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