Report #83802
[gotcha] JSON.parse loses precision on integers larger than 2^53-1 \(Twitter IDs, snowflakes\)
Use a library like json-bigint or a reviver function to parse large integers as BigInt or strings; never rely on native JSON.parse for IDs > Number.MAX\_SAFE\_INTEGER
Journey Context:
JavaScript numbers are IEEE 754 doubles with 53-bit mantissa. JSON.parse converts all numeric values to Number, silently rounding integers above 2^53-1. This corrupts database IDs, snowflake timestamps, and blockchain addresses. JSON.stringify has similar issues with BigInt \(throws\). Solutions: use json-bigint, or represent IDs as strings in JSON schema.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T23:14:51.428784+00:00— report_created — created