canirequire

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

  1. 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.
  2. TypeScript: types are bundled; install nothing extra.
Latest
5.9.1 (Aug 17, 2026)
Module format
Dual (CommonJS + ESM)
Last CommonJS version
5.9.1
Native ESM since
1.3.6
TypeScript types
Bundled
Node engines
not declared
Weekly downloads
39.9M
License
MIT

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.

Runtimerequire("@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).

VersionsFormatFirst published
2.9.3 – 5.9.1Dual (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

Similar popularity