# @nomicfoundation/hardhat-errors

> The different errors that Hardhat can throw

Latest version **3.0.21** (published 2026-08-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nomicfoundation/hardhat-errors
pnpm add @nomicfoundation/hardhat-errors
yarn add @nomicfoundation/hardhat-errors
bun add @nomicfoundation/hardhat-errors
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.0.21 |
| Published | 2026-08-27 |
| First published | 2025-02-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 1 |
| Unpacked size | 596.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 8505 |
| Author | Nomic Foundation |
| Keywords | ethereum, smart-contracts, hardhat |

## Links

- npm: https://www.npmjs.com/package/@nomicfoundation/hardhat-errors
- Repository: https://github.com/NomicFoundation/hardhat
- Homepage: https://github.com/NomicFoundation/hardhat/tree/main/packages/hardhat-errors
- Issues: https://github.com/NomicFoundation/hardhat/issues
- npm.io page: https://npm.io/package/@nomicfoundation/hardhat-errors

## Dependencies (1)

- [@nomicfoundation/hardhat-utils](https://npm.io/package/@nomicfoundation/hardhat-utils.md) ^4.1.5

## Recent versions

- 3.0.21 (latest) — 2026-08-27
- 3.0.20 — 2026-08-13
- 3.0.19 — 2026-08-12
- 3.0.18 — 2026-07-30
- 3.0.17 — 2026-07-16
- 3.0.16 — 2026-07-02
- 3.0.15 — 2026-06-04
- 3.0.14 — 2026-05-26
- 3.0.13 — 2026-05-20
- 3.0.12 — 2026-04-30
- 3.0.11 — 2026-04-16
- 3.0.10 — 2026-03-31
- 3.0.9 — 2026-03-19
- 3.0.8 — 2026-03-11
- 3.0.7 — 2026-02-25
- … 40 more at https://npm.io/package/@nomicfoundation/hardhat-errors/versions

## README

# hardhat-errors

> ⚠️ This package is an internal Hardhat component and it's not meant to be used directly.

This packages has the definition of the error classes used by Hardhat, and the list of possible errors.

This module exports:

1. The error class `HardhatError`, which has a static field `ERRORS`, with the different `ErrorDescriptors` that it accepts.
2. The error class `HardhatPluginError`, which is the recommended way to handle errors in Hardhat plugins. For convenience, it is re-exported from `@nomicfoundation/hardhat/plugins`. Plugin developers should import it from this path.
3. The interface `ErrorDescriptor`.
4. The assertion helper `assertHardhatInvariant`.

---
_Source: https://npm.io/package/@nomicfoundation/hardhat-errors · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
