question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module not found: Can't resolve 'react-hook-form-resolvers'

See original GitHub issue

Then following the instruction in https://github.com/react-hook-form/react-hook-form-resolvers/blob/master/README.md

Install the module using npm install react-hook-form-resolvers.

Then import yupResolver.

import { yupResolver } from 'react-hook-form-resolvers';

I am getting Module not found: Can't resolve 'react-hook-form-resolvers' in '{__PATH_TO_A_REMOVED_COMPONENT__}'

When I look into the node_modules/react-hook-form-resolvers it’s empty. Screenshot 2020-05-12 at 06 46 33

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
AlinDevcommented, May 12, 2020

same issue

2reactions
bluebill1049commented, May 24, 2020
const { handleSubmit, register, errors, setValue, reset } = useForm({
  resolver: (data) => yupResolver(validationSchema, { abortEarly: false, context: data })(data)
});

thanks @azizur for your feedback. I think the good thing above is universal and not only applied to yup or potential other schemas. also we will probably running into problem with cache context with above solution.

{ setValidationContext: {a:'user-provided-object'} }) }

we are cashing resolver, so user won’t have to cache it manually and context object is mutable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

hookform/resolvers
A simple and composable way to validate data in JavaScript (or TypeScript). npm. import { useForm } from 'react-hook-form' ...
Read more >
How to use yup with react hook form?
I am trying to write error handling on react hook form with yup, but when I want to pass resolver as documentation says ......
Read more >
Get Started | React Hook Form
Performant, flexible and extensible forms with easy-to-use validation.
Read more >
react-hook-form
Changed. resolver with group error object will no longer need with trigger to show and clear error. This minor version made hook form...
Read more >
npm install @hookform/resolvers yup
@hookform/resolvers/yup npm · npm install @hookform/resolvers yup · react hook form with yup resolver.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found