- Symptom
- TypeError: Do not know how to serialize a BigIntA Decimal(10,2) value of 1.50 arrives in the JSON as the string "1.5"
- Cause
- BigInt columns come back as JavaScript bigint, which JSON.stringify cannot encode. Decimal columns come back as Decimal.js objects whose JSON form is a string without the column's scale.
- Fix
- Convert both at the API boundary with a replacer or explicit mapping.
- Apply
const body = JSON.stringify(rows, (_k, v) => typeof v === 'bigint' ? v.toString() : v) // Decimal: row.price.toFixed(2) or row.price.toNumber() when precision allows- Affected
- Prisma ORM 6 and 7, reproduced on 7.10.0 with @prisma/adapter-pg
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders