Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

BigInt serialization TypeError in MonitorServiceImpl

Aperta Adatta ai principianti
#701 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Una pull request collegata è già stata integrata.

  • #703 di @karenc-bq — integrata

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
70/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
observability

Direzione di ricerca

Inizia in common/lib/utils/monitoring/monitor_service.ts, in particolare in MonitorServiceImpl.checkMonitors(), e analizza il percorso di cleanup attraverso runCleanupLoop(). Esamina le chiamate a JSON.stringify() utilizzate per il logging di Monitor, inclusa la riga indicata e i casi simili. Il lavoro è completato quando l'attività di monitoring non genera più TypeErrors di serializzazione di BigInt.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
38
Fork
15
Merge medio
5g 11h
PR unite (30g)
2

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di aws/aws-advanced-nodejs-wrapper

Tutte le issue di aws/aws-advanced-nodejs-wrapper

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.