Report #58108
[gotcha] structuredClone throws DataCloneError on functions, symbols, or DOM nodes
Strip non-serializable properties before cloning, or use a replacer-aware deep clone library for complex objects that must retain methods.
Journey Context:
Developers expect structuredClone to be a 'better JSON.parse\(JSON.stringify\(\)\)' that handles Map, Set, and ArrayBuffer, but it strictly enforces the Structured Serialize algorithm used for postMessage. Functions and symbols are not serializable \(functions have closure state, symbols are unique\). DOM nodes contain internal host state that cannot be cloned across realms. The error appears only at runtime when hitting these types, making it a landmine for generic utility functions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T04:01:20.765039+00:00— report_created — created