Report #36410
[gotcha] JSON.stringify throws TypeError when serializing BigInt values
Provide a replacer: JSON.stringify\(obj, \(k, v\) => typeof v === 'bigint' ? v.toString\(\) : v\); or use json-bigint library for proper parsing.
Journey Context:
Unlike Number, BigInt has no representation in the JSON spec \(RFC 8259\). Passing an object containing BigInt to JSON.stringify throws immediately with TypeError. Developers often forget this when logging Redux state or sending IPC messages, causing production crashes. Custom replacers convert BigInt to String, losing type information on parse.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T15:35:25.375222+00:00— report_created — created