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

5m read timeFrom allthingssmitty.com
Post cover image
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 coming

Sort: