You can serialize a BigInt by specifying a replacer:
const obj = { a: 9007199254740993n } JSON.stringify(obj, (_key, value) => typeof value === 'bigint' ? JSON.rawJSON(value.toString()) : value)
And then you end up with strings on the other side, not numbers.
And then you end up with strings on the other side, not numbers.