Prisma · sdk · fg-0284

JSON responses with Prisma results throw 'Do not know how to serialize a BigInt' or turn Decimals into strings

If you see TypeError: Do not know how to serialize a BigInt, the cause and the fix for Prisma are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
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

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun