Report #93268
[gotcha] structuredClone throws on functions but silently discards Symbol-keyed properties
Strip functions manually before cloning, or implement a custom replacer; do not rely on Symbol-keyed properties being preserved in cloned objects.
Journey Context:
structuredClone is strict for some types \(functions, DOM nodes, Error causes\) and will throw a DataCloneError immediately. However, for Symbol-keyed properties on objects, it does not throw—it silently ignores them, similar to JSON.stringify. This asymmetric behavior is dangerous: you might test with simple objects and think your clone is deep and faithful, but metadata attached via Symbols \(e.g., library-internal markers\) vanishes without warning. To avoid this, manually strip non-cloneable types before calling structuredClone, and assume Symbol keys are lost.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:08:05.599057+00:00— report_created — created