From bcef4557b57f714400f7668dc0e50ec1d0d23b26 Mon Sep 17 00:00:00 2001 From: lihan3238 Date: Fri, 8 May 2026 12:04:23 +0800 Subject: [PATCH 1/2] fix(Inspectable): handle BigInt in stringifyCircular JSON.stringify throws TypeError when encountering BigInt values. The format() method already handles BigInt by converting to string, but stringifyCircular did not, causing crashes when serializing objects containing BigInt values. Closes #4662 --- packages/effect/src/Inspectable.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/effect/src/Inspectable.ts b/packages/effect/src/Inspectable.ts index 9bab2d1e9c4..eac0488fa3b 100644 --- a/packages/effect/src/Inspectable.ts +++ b/packages/effect/src/Inspectable.ts @@ -229,7 +229,7 @@ export const stringifyCircular = (obj: unknown, whitespace?: number | string | u : cache.push(value) && (redactableState.fiberRefs !== undefined && isRedactable(value) ? value[symbolRedactable](redactableState.fiberRefs) : value) - : value, + : typeof value === "bigint" ? String(value) + "n" : value, whitespace ) ;(cache as any) = undefined From 18ec616c7049f3189adb20be6f02a2f52dfb8665 Mon Sep 17 00:00:00 2001 From: lihan3238 Date: Fri, 8 May 2026 12:11:35 +0800 Subject: [PATCH 2/2] add changeset --- .changeset/fix-inspectable-bigint.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fix-inspectable-bigint.md diff --git a/.changeset/fix-inspectable-bigint.md b/.changeset/fix-inspectable-bigint.md new file mode 100644 index 00000000000..996530efb07 --- /dev/null +++ b/.changeset/fix-inspectable-bigint.md @@ -0,0 +1,5 @@ +--- +"effect": patch +--- + +fix(Inspectable): handle BigInt in stringifyCircular