-
-
Notifications
You must be signed in to change notification settings - Fork 35k
Closed
Labels
questionIssues that look for answers.Issues that look for answers.
Description
Version
v25.8.0
Platform
Darwin mac.lan 25.3.0 Darwin Kernel Version 25.3.0: Wed Jan 28 20:55:08 PST 2026; root:xnu-12377.91.3~2/RELEASE_ARM64_T6020 arm64
Subsystem
No response
What steps will reproduce the bug?
Sample REPL output
> function CustomError() {}
undefined
> require('util').inherits(CustomError, Error);
undefined
> new CustomError() instanceof Error
true
> Error.isError(CustomError)
false
How often does it reproduce? Is there a required condition?
This happens 100% of the time
What is the expected behavior? Why is that the expected behavior?
Error.isError is meant to be a more robust replacement for Error detection vs instanceof. It should work consistently with legacy node patterns utils.inherits, without surprise.
What do you see instead?
Error.isError does not detect error types that rely on utils.inherits for extension. instanceof Error does still work in these scenarios.
Additional information
The es-shim, https://github.com/es-shims/Error.isError/blob/main/implementation.js#L64 , has the instanceof Error behavior as the final fallback, which would catch this behavior.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionIssues that look for answers.Issues that look for answers.