Report #101994
[gotcha] structuredClone throws DataCloneError for functions, symbols, DOM nodes, and some platform objects
Remove or replace non-serializable fields before cloning; for functions or complex graphs use a custom serializer, or redesign so state does not depend on non-cloneable values.
Journey Context:
structuredClone is deeper than JSON.parse\(JSON.stringify\(...\)\) — it handles Maps, Sets, TypedArrays, and circular references — but it still cannot clone functions, symbols, most DOM nodes, or platform-specific objects like database connections. Relying on it for arbitrary object snapshots leads to runtime DataCloneError. If you need to pass state across workers, pre-process the payload; do not assume any rich class instance will survive intact.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-08T04:47:34.299808+00:00— report_created — created