normalize() throws when a getter throws a Symbol or a null-prototype object
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, node.js, typescript
Línea de trabajo
Lee packages/core/src/utils/normalize.ts y céntrate en los bloques catch de normalize y stringifyValue. Reproduce el problema con los tres ejemplos de getters de la issue y comprueba si los valores capturados que son Symbols u objetos con prototipo nulo siguen escapando como excepciones. Se considera terminado cuando todos los casos devuelvan un marcador no serializable sin lanzar una excepción.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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/getsentry/sentry-javascript/releases
How do you use Sentry?
Not applicable. The reproduction calls normalize from @sentry/core directly, without a DSN.
Which SDK are you using?
@sentry/core (the normalize utility that every SDK uses)
SDK Version
11.10.0
Steps to Reproduce
Node.js 24.21.0:
const { normalize } = require('@sentry/core')
const throwsError = { get x() { throw new Error('getter failed') } }
const throwsSymbol = { get x() { throw Symbol('s') } }
const throwsNullProto = { get x() { throw Object.create(null) } }
normalize({ bad: throwsError }, 3)
normalize({ bad: throwsSymbol }, 3)
normalize({ bad: throwsNullProto }, 3)
Expected Result
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."
Actual Result
{ ERROR: '**non-serializable** (Error: getter failed)' }
TypeError: Cannot convert a Symbol value to a string
TypeError: Cannot convert object to primitive value
The second and third calls throw out of normalize.
Additional Context
Both 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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 8.8k
- Forks
- 1.9k
- Merge medio
- 1 d 19 h
- PR fusionados (30 d)
- 664
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de getsentry/sentry-javascript
-
Vercel AI: `gen_ai.system_instructions` is missing when the system prompt is a message objectAbiertoBug Package: node Spans vercel ai
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
getsentry/sentry-javascript#26079 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Bug Node.js
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
getsentry/sentry-javascript#25950 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Browser Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
getsentry/sentry-javascript#25946 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Only create Nuxt database and storage spans when there is a parent spanPosiblemente ocupada @nicohrubec la tomó hace 5 días. AbiertoImprovement Nuxt
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
getsentry/sentry-javascript#25805 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Only create Cloudflare storage and D1 db spans when there is a parent spanPosiblemente ocupada @nicohrubec la tomó hace 5 días. AbiertoCloudflare Workers Improvement Spans
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
getsentry/sentry-javascript#25804 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de getsentry/sentry-javascript
Issues similares
-
test: claim-conflict drop leaves both facts active and is never re-proposed (untested review cell)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
[Feature]: Usage page should show API-equivalent cost and say when a connected plan shows info onlyAbiertoenhancement from-x
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
nightly-labs/openbot#4867 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
egonSchiele/agency-lang#1377 ·
Los mantenedores suelen responder en 1 día
-
normalizePath removes the Windows device namespace prefixPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
caprover/caprover-frontend#273 ·
Los mantenedores suelen responder en 1 día