Report #50863
[gotcha] JSON.stringify throws TypeError when serializing BigInt values
Convert BigInt to string or number before serializing, or use a replacer function to handle BigInt explicitly
Journey Context:
BigInt was added to JS after JSON.stringify was standardized. The spec explicitly requires throwing a TypeError when encountering BigInt because there's no canonical JSON representation for arbitrary precision integers. Common workarounds include using a replacer to convert BigInt to string \(preserving precision\) or number \(risking overflow\), or using libraries that support BigInt serialization.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T15:51:38.354318+00:00— report_created — created