Report #97287
[gotcha] structuredClone throws a DataCloneError when the value contains functions, symbols, DOM nodes, or certain host objects
Strip or transform non-serializable fields before calling structuredClone, or use a custom clone strategy for methods and DOM references. Do not treat it as a universal deep clone.
Journey Context:
structuredClone uses the HTML structured serialization algorithm, which supports maps, sets, typed arrays, and transferables but explicitly rejects functions and symbols. It also loses getters and prototype chains. Developers often reach for it expecting lodash.cloneDeep semantics, then hit runtime errors. The fix is to serialize only data, or fall back to a library when behavior-bearing objects need cloning.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T04:51:47.917564+00:00— report_created — created