Library / SDK
react-hook-form/resolvers avatar
react-hook-form/resolvers

Resolvers' pnpm install line is wrong, and its manifest trails the releases by six versions

Validation resolvers: Yup, Zod, Superstruct, Joi, Vest, Class Validator, io-ts, Nope, computed-types, typanion, Ajv, TypeBox, ArkType, Valibot, effect-ts, VineJS and Standard Schema.

2,265 stars216 forksTypeScriptMIT

At a glance

What is it?
React Hook Form's resolvers package adapts twenty schema validation libraries to one resolver signature, and each is published as its own subpath export with four build outputs. The install instructions use the install subcommand for pnpm where pnpm expects add, the packaging manifest declares 5.3.0 while the releases are at 5.9.x, and three different places in the repository list different subsets of the twenty libraries.
Who is it for?
Resolvers is worth using if you already use React Hook Form and you want your validation library chosen on its own merits rather than by the form library, since this package is a thin adapter with no opinion about which schema tool you should pick. Four things to check.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 3 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • react-hook-form/resolvers2,265 ★ · +11
Star history
Repository2026-07-282026-11-15
react-hook-form/resolvers2.3k2.3k

11 Stars in the last 110 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The pnpm install line uses the subcommand pnpm does not have

The install section gives one line per package manager, each with its own comment:

code
npm install @hookform/resolvers # npm
yarn add @hookform/resolvers # yarn
pnpm install @hookform/resolvers # pnpm
bun install @hookform/resolvers # bun

Three of those four are the command you would expect for that manager. npm takes install with a package name. yarn takes add. bun takes install with a package name, which differs from npm's own convention and is why the four lines do not read uniformly.

The pnpm line is the problem. pnpm's verb for adding a dependency is add, the same as yarn's, and install is its verb for installing what is already declared. So the line a pnpm user copies does not add the package.

This is worth naming precisely because of where it sits. It is the first code on the page after one sentence of introduction, in a file whose entire purpose is to be read by someone installing a package, and it is the kind of error that does not fail loudly. Depending on the version, a pnpm install with an unexpected argument either prints usage and exits or does something other than what the comment says, and in both cases the reader is left wondering whether the package name is wrong.

Everything else on the page is careful. This line is the one that is not, which is what makes it worth reporting rather than working around.

Three places list the twenty libraries and no two lists agree

How many libraries are supported depends on where you read.

The comparison table has twenty rows. The repository description names seventeen. The packaging manifest, which is the description npm and your editor's package panel will show you, names fourteen.

The six the registry description leaves out are not obscure: they include Ajv, Valibot, Standard Schema, a schema wrapper, and a schema type wrapper. So a developer browsing the package on npm sees a list that omits one of the most widely used JSON Schema validators in the ecosystem.

The three lists also disagree on spelling and capitalisation rather than only on membership, which is the tell that they are maintained separately. The table uses a mixture of lower case and proper case in the resolver column, with the JSON Schema validator in full capitals, a type wrapper in lower case, and the rest in a case that tracks each library's own branding. The manifest description uses sentence case throughout. The repository description uses its own.

The table is the one that matters, because it is the only one that carries capability information alongside the names. Everything else is a summary that has drifted.

The capability table has two independent axes and different libraries fail each

The table has two columns and neither is the important one. The first asks whether the resolver can infer its output type from the schema. The second asks whether it supports a criteria mode that reports every error rather than only the first.

They are independent, and reading them as one judgement is the mistake. Thirteen of the twenty can infer the type from the schema. Sixteen of the twenty can report all errors. The four that cannot report all errors are not a subset of the seven that cannot infer, and only two appear in both lists.

Concretely: one library can infer the type but will only ever hand you the first error. Another can report every error but makes you declare the output type yourself. Two fail both, so they give you neither inference nor all-errors reporting. And five can report all errors but not infer, which means your form's TypeScript types and your schema can drift apart silently unless you wire the generics yourself.

That last group is the one to think about. A resolver that cannot infer means the form's type parameter and the schema's type are maintained by hand, and nothing tells you when they disagree.

The table hides this because both columns are checkmarks and one phrase. The information is there; it just takes reading it row by row.

The manifest says 5.3.0 and the published releases are at 5.9.x

The packaging manifest declares the version as `5.3.0`. The releases recorded for this repository are 5.9.1, dated 2026-08-17, 5.9.0 dated 2026-08-15, and 5.8.0 dated 2026-08-13. The last push to the repository is dated 2026-09-17, a month after the most recent release.

So there is a gap of six versions between what the manifest on the branch declares and what has been published, and the branch has moved again since the last tag.

The likely mechanism is a release script that writes the version at publish time rather than committing it, which is common in monorepos with a version-bump tool, and the repository does carry the configuration files such a tool needs. That would explain the state without making it a bug in the package.

It is still the wrong number to read if you are deciding what is current, and it is the number most tools show you. An editor's package panel, a dependency audit report and anything that reads the manifest will report 5.3.0 for a package that has had six releases since.

The releases themselves are close together, three of them inside five days in August, which is a fast cadence for a package whose entire job is a thin adapter layer.

One option in the resolver signature appears in no documentation

The whole public API is three positional arguments and one options type:

code
type Options = {
  mode: 'async' | 'sync',
  raw?: boolean
}

resolver(schema: object, schemaOptions?: object, resolverOptions: Options)

The table underneath documents three things: the schema, marked required; the schema options, described as options passed to the validation library; and the resolver options, with the note that async is the default mode.

So `raw` appears in the type and appears nowhere else on the page. It is not in the table, it has no description, and nothing on the visible page says what it changes or when you would want it. An optional boolean in a public options type is part of the API whether or not it is described.

There is a smaller inconsistency in the same block. `mode` is declared without a question mark in the type, so it reads as required, while the table says async is the default, which implies you can leave it out. Either the type is stricter than the behaviour or the note is loose, and a caller writing configuration by hand would have to guess which.

Both of these are the kind of gap that a longer document would close. This one is a README whose API section is four lines, so anything not in those four lines and the table is undocumented.

Yup's context is silently overridden by the form context

The quickstart opens with a warning that is more useful than the example it precedes, and it is specific to one resolver.

Context has to be passed through the form rather than through the resolver. The resolver's own schema options carry a context field, and the form's context overrides it. So passing context the obvious way, as an option to the resolver, appears to work and does not:

code
// Correct
useForm({
  resolver: yupResolver(schema),
  context: { foo: true },
});

// Avoid - schemaOptions.context will be ignored/overridden
yupResolver(schema, { context: { foo: true } });

The failure mode is what makes this worth a section. There is no error. The context is simply discarded in favour of whatever the form carries, and since the form's context is usually undefined, a schema that requires context sees nothing and either passes vacuously or fails for a reason that points at the schema.

The second warning in the same quickstart is a different shape of trap. A field with a default in the schema becomes optional on the schema's input type and stays required on its output type, because the default is only filled in after validation. Passing one generic to the form pins both to the same type, which conflicts with the resolver, since the resolver infers input and output separately.

Two git hook tools, one linter, and four build outputs per library

The build shape explains the packaging surface.

Each library gets its own directory at the repository root, twenty of them, and its own entry in the exports map. Each subpath export declares four conditions: type declarations, a UMD build, an ES module build, and a CommonJS build. The root entry does the same, plus a separate module and source field. So twenty adapters produce eighty build outputs, which is the cost of letting a bundler pull in only the one validator you use instead of all twenty.

The tooling is mostly consolidated. A single linter and formatter configuration replaces the usual linter-plus-formatter pair. Type checking has a general configuration and a separate build configuration. The test runner is Vitest, in a config file.

Two things are not consolidated. The repository carries both a Husky directory and a lefthook configuration file, which are two different tools for the same job, installing git hooks. And the lockfile is a Bun one while the install instructions cover four package managers, so the project develops with one manager and documents four.

None of that is a problem in itself. It is the shape of a package that grew one adapter at a time, and it shows up most clearly in the version mismatch, which is the kind of thing that tooling would catch if the tooling and the version lived in the same place.

Editorial conclusion

Resolvers is worth using if you already use React Hook Form and you want your validation library chosen on its own merits rather than by the form library, since this package is a thin adapter with no opinion about which schema tool you should pick. Four things to check. The install line, because the pnpm entry uses the install subcommand where pnpm expects add, and if pnpm is your package manager that line will not do what the comment beside it claims. The capability matrix, because its two columns are independent and the libraries that fail one are not the libraries that fail the other: thirteen of the twenty infer their output type from the schema and sixteen can report every error rather than only the first, so check both columns for your library rather than assuming a row that looks supported in one respect is supported in the other. The version, because the manifest declares 5.3.0 while the published releases are at 5.9.x, so read the release list rather than the manifest when deciding what is current. And the context trap in the Yup resolver, where a value passed through the resolver's schema options is overridden by the form context without warning, which is the kind of thing that costs an afternoon. And read the resolver you actually use end to end rather than assuming every one behaves the same way, because the per-library warnings are scattered through a long quickstart.

Frequently asked questions

how to install hookform resolvers

Install the package alongside the validation library you intend to use. The readme gives one line per package manager: npm install @hookform/resolvers for npm, yarn add for yarn, pnpm install for pnpm, and bun install for bun.

how to install hookform resolvers zod

The same package, with the Zod resolver imported from its subpath as zodResolver alongside the schema from zod. The example notes the schema import works from either zod or zod/v4.

how to install hookform resolvers yup

The same package, with the Yup resolver imported from its subpath as yupResolver. The readme warns that context must be passed through useForm's context option rather than the resolver's schema options, because the form context overrides it.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
  4. Release notes
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/react-hook-form-resolvers.svg)](https://hysenlabs.com/projects/react-hook-form-resolvers)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/react-hook-form-resolvers.svg)](https://hysenlabs.com/projects/react-hook-form-resolvers)

Was this useful?