Report #69454
[gotcha] Error cause property is lost during JSON serialization
When propagating errors across boundaries \(logging, HTTP responses\), explicitly extract the cause: \`const errorInfo = \{ message: err.message, cause: err.cause, stack: err.stack \}\` before JSON.stringify. Do not rely on default serialization.
Journey Context:
The Error cause proposal enables error chaining via \`new Error\('msg', \{ cause: err \}\)\`. However, the specification defines \`cause\` as a non-enumerable own property. \`JSON.stringify\` only captures enumerable properties, so \`cause\` disappears silently when logging errors to external systems. Developers must manually extract it or use a custom replacer to preserve the chain.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:03:55.926299+00:00— report_created — created