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.

[Bug]: Document issue

See original GitHub issue

Version Number

7.15.4

Codesandbox/Expo snack

https://codesandbox.io/s/sweet-dream-58m9v

Steps to reproduce

  1. Code was copied from the documentation.
  2. Run tsc
  3. Or in VSCode in the line it shows the error.

Expected behaviour

Without any issue.

What browsers are you seeing the problem on?

No response

Relevant log output

Type error: Type '(values: unknown, context: object, options: ResolverOptions<AssertsShape<Assign<ObjectShape, { firstName: RequiredStringSchema<string, Record<string, any>>; age: RequiredNumberSchema<number, Record<...>>; }>>>) => Promise<...>' is not assignable to type 'Resolver<IFormInputs, object>'.
  Types of parameters 'options' and 'options' are incompatible.
    Type 'ResolverOptions<IFormInputs>' is not assignable to type 'ResolverOptions<AssertsShape<Assign<ObjectShape, { firstName: RequiredStringSchema<string, Record<string, any>>; age: RequiredNumberSchema<number, Record<string, any>>; }>>>'.
      Type 'IFormInputs' is not assignable to type 'AssertsShape<Assign<ObjectShape, { firstName: RequiredStringSchema<string, Record<string, any>>; age: RequiredNumberSchema<number, Record<string, any>>; }>>'.
        Index signature for type 'string' is missing in type 'IFormInputs'.

  53 |     formState: { errors },
  54 |   } = useForm<IFormInputs>({
> 55 |     resolver: yupResolver(schema),
     |     ^
  56 |   });
  57 |   const onSubmit = (data: IFormInputs) => console.log(data);
  58 | 
error Command failed with exit code 1.

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:34 (22 by maintainers)

github_iconTop GitHub Comments

4reactions
bluebill1049commented, Oct 4, 2021

@wroughtec adding the .required() fix the issue as well.

const SignupSchema = Yup.object().shape(
  {
    min: Yup.number()
      .min(0)
      .max(20)
      .when("max", {
        is: (val) => val,
        then: Yup.number().required().max(Yup.ref("max"))
      }),
    max: Yup.number()
      .min(0)
      .max(20)
      .when("min", {
        is: (val) => val,
        then: Yup.number().required().min(Yup.ref("min"))
      })
  },
  [["min", "max"]]
).required();
4reactions
bluebill1049commented, Sep 22, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Write A Good Bug Report? Tips and Tricks
Summary: A brief summary of the bug, mostly within 60 words or below. Make sure your summary is reflecting on what the problem...
Read more >
What Is A Bug Report? The Essential Guide + Examples Of ...
So here's the core question: What is a bug report? If bugs occur (which they certainly do), the person finding the bug should...
Read more >
14 Bug Reporting Templates You Can Copy for Your QA ...
Check out these 14 super actionable bug report templates, tailored for your issue tracker like Jira, GitHub, Trello, Asana, Excel and more.
Read more >
How to write a bug report effectively: examples and templates
Briefly describe the bug, i.e. "Calculator: incorrect result of multiplication". Try to be concise, but specific here. For example, "Broken ...
Read more >
How to write an actionable bug report (free template to get ...
Bug reports allow testers to document issues, bring them to the attention of the developers, and set in motion the process that will ......
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