canirequire › Dual (CommonJS + ESM) › @hookform/resolvers
Is @hookform/resolvers ESM-only? Can you require() it?
React Hook Form validation resolvers: Yup, Joi, Superstruct, Zod, Vest, Class Validator, io-ts, Nope, computed-types, TypeBox, arktype, Typanion, Effect-TS and VineJS
Last verified Sep 9, 2026 against @hookform/resolvers@5.9.1. Markdown · JSON
Dual (CommonJS + ESM) Dual package — require() works on every Node.js version we test; import works too
@hookform/resolvers publishes both a CommonJS entry and a native ESM entry (ESM added in 1.3.6). require("@hookform/resolvers") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. import "@hookform/resolvers" works alongside it.
What to do
- Nothing to change. require("@hookform/resolvers") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. import * as resolvers from "@hookform/resolvers" works alongside it; use named imports for what the ESM entry exports.
- TypeScript: types are bundled; install nothing extra.
Does @hookform/resolvers@5.9.1 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("@hookform/resolvers") from a CommonJS file and import "@hookform/resolvers" from an ES module.
| Runtime | require("@hookform/resolvers") | import "@hookform/resolvers" |
|---|---|---|
| Node.js 18 | ✓ works | ✓ works |
| Node.js 20 | ✓ works | ✓ works |
| Node.js 22 | ✓ works | ✓ works |
| Node.js 24 | ✓ works | ✓ works |
| Node.js 26 | ✓ works | ✓ works |
| Bun 1.4.0 | ✓ works | ✓ works |
How to import @hookform/resolvers
ES modules (import)
import * as resolvers from "@hookform/resolvers";Namespace import shown because the ESM entry may have no default export; use named imports for what it exports.
CommonJS (require)
const resolvers = require("@hookform/resolvers");Module format by version
Derived from the type, main and exports fields of every stable release on npm, corrected where a runtime test of that version contradicted them (112 versions; the newest 60 shown).
| Versions | Format | First published |
|---|---|---|
| 2.9.3 – 5.9.1 | Dual (CommonJS + ESM) | Jun 24, 2022 |
Frequently asked
Is @hookform/resolvers ESM-only?
@hookform/resolvers@5.9.1 ships CommonJS and ESM builds. @hookform/resolvers publishes both a CommonJS entry and a native ESM entry (ESM added in 1.3.6). require("@hookform/resolvers") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. import "@hookform/resolvers" works alongside it.
Can I require @hookform/resolvers?
Yes. @hookform/resolvers ships a CommonJS entry alongside the native ESM entry. require("@hookform/resolvers") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun.
Does @hookform/resolvers work in Bun?
Yes. import "@hookform/resolvers" loaded successfully in Bun 1.4.0 on Sep 9, 2026.
Does @hookform/resolvers ship TypeScript types?
Yes. @hookform/resolvers bundles its own type declarations; no @types package is needed.
Links
Other dual (commonjs + esm) packages
- minimatch 10.2.6Dual
- brace-expansion 5.0.9Dual
- lru-cache 11.5.2Dual
- tslib 2.8.1Dual
- glob 13.0.6Dual
- eslint-visitor-keys 5.0.1Dual
- yallist 5.0.0Dual
- balanced-match 4.0.4Dual
Similar popularity
- package-json-from-dist 1.0.1Dual
- terser-webpack-plugin 5.6.1CommonJS
- @radix-ui/react-scroll-area 1.2.18Dual
- glob-to-regexp 0.4.1CommonJS
- @sinonjs/commons 4.0.0-alpha.0Dual
- @smithy/util-middleware 4.5.2CommonJS
- bluebird 3.7.2CommonJS
- @aws-sdk/middleware-recursion-detection 3.972.46CommonJS