Error AtlasError Documentation and Resolution

JavaScript BigInt value cannot be serialized in JSON

TypeError: BigInt value can't be serialized in JSON

JavaScript failed to stringify data because JSON does not support BigInt values directly.

TypeError: BigInt value can't be serialized in JSONjson
TypeError: BigInt value can't be serialized in JSON
  • JSON.stringify encountered a BigInt value.
  • A data structure contains BigInt fields that were not normalized for JSON output.
  • A response or storage layer assumes JSON can handle BigInt directly.
  1. Convert BigInt values to strings or another supported representation before serialization.
  2. Use a replacer function with JSON.stringify if conversion must happen centrally.
  3. Check API contracts and persistence layers for BigInt compatibility.
MDN: TypeError: BigInt value can't be serialized in JSON
JavaScript BigInt value can't be serialized in JSON | Error Atlas