Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

BigInt serialization TypeError in MonitorServiceImpl

Cerrado Apto para principiantes
#701 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 8 días

Ya se ha fusionado un pull request relacionado.

  • #703 de @karenc-bq — fusionado

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
70/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

Comienza en common/lib/utils/monitoring/monitor_service.ts, especialmente en MonitorServiceImpl.checkMonitors(), e inspecciona la ruta de cleanup a través de runCleanupLoop(). Revisa las llamadas a JSON.stringify() utilizadas para el registro de Monitor, incluida la línea referenciada y casos similares. Se considera terminado cuando la actividad de monitorización ya no provoca TypeErrors de serialización de BigInt.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug pending release
Describe the bug

After upgrading to 3.0.0, I've started to see uncaught exceptions from within the library for TypeError: Do not know how to serialize a BigInt. It appears that MonitorServiceImpl::checkMonitors() attempts to serialize Monitor objects for logging with JSON.stringify(), but these include BigInt members that fail. One such place is:

https://github.com/aws/aws-advanced-nodejs-wrapper/blob/c0a7320e282453a1f023a6d95466d93078d2134d/common/lib/utils/monitoring/monitor_service.ts#L211

There appear to be several other similar cases throughout monitor_service.ts.

Expected Behavior

No exceptions attempting to serialize BigInt.

What plugins are used? What other connection properties were set?

efm2

Current Behavior

Example stack trace:

TypeError: Do not know how to serialize a BigInt
at JSON.stringify ()
at MonitorServiceImpl.checkMonitors (file:///redacted/node_modules/aws-advanced-nodejs-wrapper/dist/common/lib/utils/monitoring/monitor_service.js:148:81)
at MonitorServiceImpl.runCleanupLoop (file:///redacted/node_modules/aws-advanced-nodejs-wrapper/dist/common/lib/utils/monitoring/monitor_service.js:106:18)
} reason: TypeError: Do not know how to serialize a BigInt
at JSON.stringify ()
at MonitorServiceImpl.checkMonitors (file:///redacted/node_modules/aws-advanced-nodejs-wrapper/dist/common/lib/utils/monitoring/monitor_service.js:148:81)
at MonitorServiceImpl.runCleanupLoop (file:///redacted/node_modules/aws-advanced-nodejs-wrapper/dist/common/lib/utils/monitoring/monitor_service.js:106:18)

Reproduction Steps

I don't have a quick reproducer since the issue seems to depend on the the monitoring state and activity. In my application, this sometimes happen after some period of inactivity or just before/after activity. I believe attempting to JSON.stringify() a BigInt is always an error unless the library were to provide a replacer function to JSON.stringify().

Possible Solution

Provide a replacer function to JSON.stringify() to handle the BigInt fields or perform some alternative serialization of the Monitor objects for logging.

Additional Information/Context

This is my first bug report here. Thanks for the great library.

The AWS Advanced NodeJs Wrapper version used

3.0.0

Node version used

24

Operating System and version

Rocky Linux 8.10

Lenguaje dominante
TypeScript
Estrellas
38
Forks
17
Merge medio
7 d 9 h
PR fusionados (30 d)
8

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de aws/aws-advanced-nodejs-wrapper

Todos los issues de aws/aws-advanced-nodejs-wrapper

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.