JavaScript's `instanceof Error` check silently fails when errors originate from different execution realms (iframes, workers, browser extensions, SSR). The new `Error.isError()` static method solves this by checking an internal engine-level brand rather than the prototype chain, making it realm-safe. It returns `true` for all real Error objects including subclasses and DOMExceptions, and `false` for plain objects mimicking errors. Supported in Chrome 134+, Firefox 138+, Edge 134+, and Node.js 24.3+, with a simple feature-detection wrapper provided for backward compatibility.
Table of contents
The cross-realm problemWhy instanceof breaks downEnter Error.isError()When should you use this?Adopting it without a big refactorCan you use this today?The bug you don’t see comingSort: