Get to know MDN better
The structured clone algorithm copies complex JavaScript objects. It is used internally when invoking structuredClone(), to transfer data between Workers via postMessage(), storing objects with IndexedDB, or copying objects for other APIs.
It clones by recursing through the input object while maintaining a map of previously visited references, to avoid infinitely traversing cycles.
For Error types, the error name must be one of: Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError (or will be set to "Error").
Browsers must serialize the properties name and message, and are expected to serialize other "interesting" properties of the errors such as stack, cause, etc.
AggregateError support is expected to be added to the specification in whatwg/html#5749 (and is already supported in some browsers).
Note: Serializable objects are marked up in Web IDL files with the attribute [Serializable].
This page was last modified on Jun 29, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.