Report #100607
[gotcha] structuredClone silently drops functions, DOM nodes, and prototype chains, and throws on non-serializable types
Only use structuredClone for fully serializable data \(plain objects, arrays, primitives, typed arrays, Maps, Sets\). Remove functions, class instances, and DOM references before cloning, or implement a custom clone strategy.
Journey Context:
structuredClone uses the structured clone algorithm. It preserves circular references and many built-in types, but functions and DOM nodes are not structured-cloneable and will cause DataCloneError. Class instances lose their prototype and become plain objects. It is not a drop-in replacement for lodash.cloneDeep if your data contains non-serializable values; validate inputs or handle DataCloneError explicitly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-02T04:47:23.768463+00:00— report_created — created