coderef

Error causeBaseline · Widely available

The cause property of errors records the specific original cause of the error, particularly for errors that have been re-thrown.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Sep 20, 2021. Widely available since Mar 20, 2024.

Browser support

DesktopChrome
1–92Not supported
93+Supportedsince Aug 31, 2021
Current: 155
Edge
12–92Not supported
93+Supportedsince Sep 2, 2021
Current: 154
Firefox
1–90Not supported
91+Supportedsince Aug 10, 2021
Current: 157
Safari
1–14.1Not supported
15+Supportedsince Sep 20, 2021
Current: 27
MobileChrome Android
18–92Not supported
93+Supportedsince Aug 31, 2021
Current: 155
Firefox Android
4–90Not supported
91+Supportedsince Aug 10, 2021
Current: 157
Safari iOS
1–14.5Not supported
15+Supportedsince Sep 20, 2021
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: cause.

Feature detection

JS · check before using
if ("cause" in Error || ("prototype" in Error && "cause" in Error.prototype)) {
  // Error.cause is available
}

Documentation (MDN)

Specification

Sub-features

Support for each part of the feature (2). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Error.Error.options_cause_parameter93939115939115
Error.cause93939115939115