Prisma · sdk · fg-0284

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

TypeError: Do not know how to serialize a BigInt

Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100

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

Affects: Prisma ORM 6 and 7, reproduced on 7.10.0 with @prisma/adapter-pg

Sources

Have your agent know this before it fails

claude mcp add --transport http footgun https://getfootgun.com/api/mcp