Title: Inaccurate Error reporting in Cloudflare Workers · Issue #17588 · getsentry/sentry-javascript · GitHub
Open Graph Title: Inaccurate Error reporting in Cloudflare Workers · Issue #17588 · getsentry/sentry-javascript
X Title: Inaccurate Error reporting in Cloudflare Workers · Issue #17588 · getsentry/sentry-javascript
Description: Environment Using Nuxt and Cloudflare Workers (not sure if it's at the Nuxt, Nitro or V8 level). Steps to Reproduce I set up a repo with the latest versions of Nuxt, Wrangler and Sentry SDK to easily reproduce. main branch shows how erro...
Open Graph Description: Environment Using Nuxt and Cloudflare Workers (not sure if it's at the Nuxt, Nitro or V8 level). Steps to Reproduce I set up a repo with the latest versions of Nuxt, Wrangler and Sentry SDK to easi...
X Description: Environment Using Nuxt and Cloudflare Workers (not sure if it's at the Nuxt, Nitro or V8 level). Steps to Reproduce I set up a repo with the latest versions of Nuxt, Wrangler and Sentry SDK to ...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/17588
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inaccurate Error reporting in Cloudflare Workers","articleBody":"### Environment\nUsing Nuxt and Cloudflare Workers (not sure if it's at the Nuxt, Nitro or V8 level).\n\n### Steps to Reproduce\nI set up a repo with the latest versions of Nuxt, Wrangler and Sentry SDK to easily reproduce.\n\n* [main branch](https://github.com/Buzut/sentry-nuxt-v4/tree/main) shows how error are reported in Worker environment\n* [baseline branch](https://github.com/Buzut/sentry-nuxt-v4/tree/baseline) shows the basic node setup with proper error reporting and stack traces\n\nI'm not sure about the Cloudflare specific configuration as [the docs](https://docs.sentry.io/platforms/javascript/guides/cloudflare/frameworks/nuxt/) mention the old Cloudflare Pages product, not Workers.\n\nFor that reason, I left in the repo both the `/server/plugins/sentry-cloudflare-plugin.ts` and `sentry.server.config.ts` although it is mentioned to have either one at a time (easy to delete for testing).\n\nIt's also worth mentioning that I tried both normal and the limited (`top-level-import`) methods.\n\n### Expected Result\n\n# Error: Nuxt Server Error 4\n\n**Issue ID:** 6869389825\n**Project:** sentry-test\n**Date:** 10/09/2025, 15:13:58\n\n## Tags\n\n- **browser:** Chrome 138.0.0\n- **browser.name:** Chrome\n- **client_os:** macOS\n- **client_os.name:** macOS\n- **environment:** production\n- **handled:** no\n- **level:** error\n- **mechanism:** generic\n- **os:** macOS 14.7.6\n- **os.name:** macOS\n- **release:** 3bffb684f168a67f1d50a894681f4020087b9779\n- **runtime:** node v24.4.1\n- **runtime.name:** node\n- **server_name:** MacBook-Air.local\n- **transaction:** GET /api/error\n- **url:** http://localhost:3000/api/error\n\n## Exception\n\n### Exception 1\n**Type:** Error\n**Value:** Nuxt Server Error\n\n#### Stacktrace\n\n```\n createError$1 in /Users/buzut/Downloads/sentry-nuxt/.output/server/chunks/nitro/nitro.mjs [Line 978] (In app)\n return obj;\n }\n}\nfunction createError$1(input) {\n if (typeof input === \"string\") {\n return new H3Error(input); \u003c-- SUSPECT LINE\n }\n if (isError(input)) {\n return input;\n }\n const err = new H3Error(input.message ?? input.statusMessage ?? \"\", {\n error in ./server/api/error.js [Line 2] (In app)\nexport default eventHandler((event) => {\n throw createError('Nuxt Server Error'); \u003c-- SUSPECT LINE\n});\n Unknown function in /Users/buzut/Downloads/sentry-nuxt/.output/server/chunks/nitro/nitro.mjs [Line 1852] (In app)\n };\n const handler = eventHandler((event) => {\n if (_resolved) {\n return _resolved.handler(event);\n }\n return resolveHandler().then((r) => r.handler(event)); \u003c-- SUSPECT LINE\n });\n handler.__resolve__ = resolveHandler;\n return handler;\n}\nconst lazyEventHandler = defineLazyEventHandler;\n Object.? in /Users/buzut/Downloads/sentry-nuxt/.output/server/chunks/nitro/nitro.mjs [Line 1921] (In app)\n if (layer.match && !layer.match(_layerPath, event)) {\n continue;\n }\n event._path = _layerPath;\n event.node.req.url = _layerPath;\n const val = await layer.handler(event); \u003c-- SUSPECT LINE\n const _body = val === void 0 ? void 0 : await val;\n if (_body !== void 0) {\n const _response = { body: _body };\n if (options.onBeforeResponse) {\n event._onBeforeResponseCalled = true;\n Unknown function in /Users/buzut/Downloads/sentry-nuxt/.output/server/chunks/nitro/nitro.mjs [Line 4544] (In app)\n debug$1.log(\n `Patched h3 event handler. ${isolationScope === newIsolationScope ? \"Using existing\" : \"Created new\"} isolation scope.`\n );\n return withIsolationScope(newIsolationScope, async () => {\n try {\n return await handlerTarget.apply(handlerThisArg, handlerArgs); \u003c-- SUSPECT LINE\n } finally {\n await flushIfServerless();\n }\n });\n }\n Server.toNodeHandle in /Users/buzut/Downloads/sentry-nuxt/.output/server/chunks/nitro/nitro.mjs [Line 2192] (In app)\n}\nfunction toNodeListener(app) {\n const toNodeHandle = async function(req, res) {\n const event = createEvent(req, res);\n try {\n await app.handler(event); \u003c-- SUSPECT LINE\n } catch (_error) {\n const error = createError$1(_error);\n if (!isError(_error)) {\n error.unhandled = true;\n }\n```\n\n\nWhat you thought would happen.\n\n### Actual Result\n\n# FetchError: [GET] \"/api/error\": 500 Server Error\n\n**Issue ID:** 6869165189\n**Project:** sentry-test\n**Date:** 10/09/2025, 15:33:04\n\n## Tags\n\n- **browser:** Chrome 138.0.0\n- **browser.name:** Chrome\n- **device:** Mac\n- **device.family:** Mac\n- **environment:** production\n- **handled:** no\n- **level:** error\n- **mechanism:** auto.browser.global_handlers.onunhandledrejection\n- **os:** Mac OS X >=10.15.7\n- **os.name:** Mac OS X\n- **release:** 3bffb684f168a67f1d50a894681f4020087b9779\n- **transaction:** /\n- **url:** http://localhost:8787/\n\n## Exception\n\n### Exception 1\n**Type:** FetchError\n**Value:** [GET] \"/api/error\": 500 Server Error\n\n#### Stacktrace\n\n```\n $fetchRaw in ./node_modules/ofetch/dist/shared/ofetch.03887fc3.mjs [Line 311] (Not in app)\n await callHooks(\n context,\n context.options.onResponseError\n );\n }\n return await onError(context); \u003c-- SUSPECT LINE\n }\n return context.response;\n };\n const $fetch = async function $fetch2(request, options) {\n const r = await $fetchRaw(request, options);\n $fetch in ./node_modules/ofetch/dist/shared/ofetch.03887fc3.mjs [Line 316] (Not in app)\n return await onError(context);\n }\n return context.response;\n };\n const $fetch = async function $fetch2(request, options) {\n const r = await $fetchRaw(request, options); \u003c-- SUSPECT LINE\n return r._data;\n };\n $fetch.raw = $fetchRaw;\n $fetch.native = (...args) => fetch(...args);\n $fetch.create = (defaultOptions = {}, customGlobalOptions = {}) => createFetch({\n```\n\n\nNote that the behaviour is the same if using the local WorkerD server or a real deployment on Cloudflare servers.\n","author":{"url":"https://github.com/Buzut","@type":"Person","name":"Buzut"},"datePublished":"2025-09-10T13:55:25Z","url":"https://github.com/getsentry/sentry-javascript/issues/17588"}
| 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:4e913844-4ff3-6f0f-8b60-f3cdd3d819d7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ACD6:C51C8:1724560:1F16850:6B053C07 |
| html-safe-nonce | c61dcb7de1630c4a40f84c7ffaf60e2643944a62bc0e27e037fa01c96e4ac5ad |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQ0Q2OkM1MUM4OjE3MjQ1NjA6MUYxNjg1MDo2QjA1M0MwNyIsInZpc2l0b3JfaWQiOiI4Nzk5NDQyNzMzNDIyMTY0OTk5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 137c82c646c9828c7dbde81977815baf6d73020eb0685508c5cecaa6872e9f71 |
| hovercard-subject-tag | issue:3402632641 |
| 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/17588/issue_layout |
| twitter:image | https://opengraph.githubassets.com/75ae99ac8bf0677d71dc21459dabe9d4ff4de4ff965f2042f49f70b190f66974/getsentry/sentry-javascript/issues/17588 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/75ae99ac8bf0677d71dc21459dabe9d4ff4de4ff965f2042f49f70b190f66974/getsentry/sentry-javascript/issues/17588 |
| og:image:alt | Environment Using Nuxt and Cloudflare Workers (not sure if it's at the Nuxt, Nitro or V8 level). Steps to Reproduce I set up a repo with the latest versions of Nuxt, Wrangler and Sentry SDK to easi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Buzut |
| hostname | github.com |
| expected-hostname | github.com |
| None | 854d880890b5e847b3fce9d1b31f032107baeddeebad2aa379c48aa4f1451f6b |
| 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 | 220e980097d94ce616d5d11fbd5316d208e3fc93 |
| 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