Title: normalize() throws when a getter throws a Symbol or a null-prototype object · Issue #25920 · getsentry/sentry-javascript · GitHub
Open Graph Title: normalize() throws when a getter throws a Symbol or a null-prototype object · Issue #25920 · getsentry/sentry-javascript
X Title: normalize() throws when a getter throws a Symbol or a null-prototype object · Issue #25920 · 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/25920
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"normalize() throws when a getter throws a Symbol or a null-prototype object","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\nNot applicable. The reproduction calls `normalize` from `@sentry/core` directly, without a DSN.\n\n### Which SDK are you using?\n\n`@sentry/core` (the `normalize` utility that every SDK uses)\n\n### SDK Version\n\n11.10.0\n\n### Steps to Reproduce\n\nNode.js 24.21.0:\n\n```js\nconst { normalize } = require('@sentry/core')\n\nconst throwsError = { get x() { throw new Error('getter failed') } }\nconst throwsSymbol = { get x() { throw Symbol('s') } }\nconst throwsNullProto = { get x() { throw Object.create(null) } }\n\nnormalize({ bad: throwsError }, 3)\nnormalize({ bad: throwsSymbol }, 3)\nnormalize({ bad: throwsNullProto }, 3)\n```\n\n### Expected Result\n\n`normalize` returns the `**non-serializable**` marker for all three, as its JSDoc states: \"returns A normalized version of the object, or `\"**non-serializable**\"` if any errors are thrown during normalization.\"\n\n### Actual Result\n\n```text\n{ ERROR: '**non-serializable** (Error: getter failed)' }\nTypeError: Cannot convert a Symbol value to a string\nTypeError: Cannot convert object to primitive value\n```\n\nThe second and third calls throw out of `normalize`.\n\n### Additional Context\n\nBoth `catch` blocks in `packages/core/src/utils/normalize.ts` (in `normalize` and in `stringifyValue`) build the marker with a template literal, `` `**non-serializable** (${err})` ``. The template literal converts the caught value to a string. That conversion throws for a Symbol and for an object without a usable `toString` or `Symbol.toPrimitive`. The current `develop` branch has the same code. A conversion that cannot throw, with a fixed fallback text, would keep `normalize` total.\n","author":{"url":"https://github.com/shi-rudo","@type":"Person","name":"shi-rudo"},"datePublished":"2026-10-29T22:42:51Z","url":"https://github.com/getsentry/sentry-javascript/issues/25920"}
| 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:6abb6b60-8303-8ab6-aad1-ec1714ecdf5f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BF82:1FAF:18141D2:2042270:6B043177 |
| html-safe-nonce | 62f65854d55bf7cbf8c13cabec42be7ea663391e39137ad45c1c1ccb4367a8d4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjgyOjFGQUY6MTgxNDFEMjoyMDQyMjcwOjZCMDQzMTc3IiwidmlzaXRvcl9pZCI6IjkwMjczNjM5OTQ4NDcxNjI3NDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0f981795c97c04d60578e4db515e595265613a6c27b3e628b6578d9449ebc8db |
| hovercard-subject-tag | issue:6109772085 |
| 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/25920/issue_layout |
| twitter:image | https://opengraph.githubassets.com/eeee511924c2f7eebc4355cb96a2b55de2dfe48fa0ac65c8b43379272892e929/getsentry/sentry-javascript/issues/25920 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/eeee511924c2f7eebc4355cb96a2b55de2dfe48fa0ac65c8b43379272892e929/getsentry/sentry-javascript/issues/25920 |
| 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 | shi-rudo |
| 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 | canary-1 |
| 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