Serializable errorsLimited availability
The DOMException, Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, and URIError objects are serializable. You can call structuredClone() on an error object or pass it to a worker using postMessage().
Not yet supported in all major browsers — check the table and provide a fallback.
Browser support
DesktopChrome
1–76Not supported
77+Supportedsince Sep 10, 2019
Current: 155Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154Firefox
1–102Not supported
103+Supportedsince Jul 26, 2022
Current: 157Safari
✕Not supportedup to 27
Current: 27MobileChrome Android
18–76Not supported
77+Supportedsince Sep 10, 2019
Current: 155Firefox Android
4–102Not supported
103+Supportedsince Jul 26, 2022
Current: 157Safari iOS
✕Not supportedup to 27
Current: 27How to use
Not supported in Safari, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.
Example
Full syntax and examples are on MDN: Serializable object.
Feature detection
JS · check before using
if ("serializable_object" in Error || ("prototype" in Error && "serializable_object" in Error.prototype)) {
// Error.serializable_object is available
}Documentation (MDN)
Specification
Sub-features
Support for each part of the feature (8). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| DOMException.serializable_object | 77 | 79 | 101 | ✕ | 77 | 101 | ✕ |
| Error.serializable_object | 77 | 79 | 103 | ✕ | 77 | 103 | ✕ |
| EvalError.serializable_object | 77 | 79 | 103 | ✕ | 77 | 103 | ✕ |
| RangeError.serializable_object | 77 | 79 | 103 | ✕ | 77 | 103 | ✕ |
| ReferenceError.serializable_object | 77 | 79 | 103 | ✕ | 77 | 103 | ✕ |
| SyntaxError.serializable_object | 77 | 79 | 103 | ✕ | 77 | 103 | ✕ |
| TypeError.serializable_object | 77 | 79 | 103 | ✕ | 77 | 103 | ✕ |
| URIError.serializable_object | 77 | 79 | 103 | ✕ | 77 | 103 | ✕ |