effect icon indicating copy to clipboard operation
effect copied to clipboard

Handle BigInt safely in Inspectable.stringifyCircular

Open aniravi24 opened this issue 9 months ago • 0 comments

What version of Effect is running?

3.14.2

What steps can reproduce the bug?

Use Effect.log* with the Effect json logger on a Cause.prettyError (which holds a span with a status that contains a bigint).

What is the expected behavior?

It shouldn't cause an error - when this log fails it causes a defect that can fail silently.

What do you see instead?

'Do not know how to serialize a BigInt': TypeError: Do not know how to serialize a BigInt at JSON.stringify () at stringifyCircular (/node_modules/.pnpm/[email protected]/node_modules/effect/src/Inspectable.ts:110:23) at options (/node_modules/.pnpm/[email protected]/node_modules/effect/src/internal/logger.ts:96:43) at opts (/node_modules/.pnpm/[email protected]/node_modules/effect/src/internal/fiberRuntime.ts:1433:55) at f (/node_modules/.pnpm/[email protected]/node_modules/effect/src/internal/fiberRuntime.ts:866:18) at withRedactableContext (/node_modules/.pnpm/[email protected]/node_modules/effect/src/Inspectable.ts:159:12) at log (/node_modules/.pnpm/[email protected]/node_modules/effect/src/internal/fiberRuntime.ts:864:19) at fiberState (/node_modules/.pnpm/[email protected]/node_modules/effect/src/internal/core-effect.ts:895:16)

Additional information

I don't use BigInts anywhere, so I don't think it could come from anything else.

aniravi24 avatar Mar 28 '25 17:03 aniravi24