Report #17044
[gotcha] structuredClone throws DataCloneError for functions, DOM nodes, or property getters
Strip functions and non-serializable properties before cloning; use toJSON\(\) methods or manually map to POJOs. For DOM nodes, use cloneNode or serialize to string.
Journey Context:
structuredClone appears to be a 'deep copy' panacea, but the HTML spec explicitly forbids cloning functions, errors with non-serializable types, and silently ignores property descriptors/getters. This breaks when cloning class instances with methods. Pre-serialize to plain objects.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T04:19:22.607538+00:00— report_created — created