Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken on yup 1.0.0. #822

Open
supermar1010 opened this issue Feb 14, 2023 · 3 comments
Open

Broken on yup 1.0.0. #822

supermar1010 opened this issue Feb 14, 2023 · 3 comments

Comments

@supermar1010
Copy link

Hello,
since updateing to yup 1.0.0 I get the following error message

 ERROR(vue-tsc)  Property 'phone' does not exist on type 'StringSchema<string | undefined, AnyObject, undefined, "">'.
 FILE  /Users/mariojacobi/Repositories/sofi-landing-page/pages/group/[id].vue:194:40

    192 |     vibe: yup.string().required(),
    193 |     phoneNumber: yup.string().test('test-phone', "This phone number doesn't seem to look valid", (value) => {
  > 194 |       if (value) { return yup.string().phone().isValidSync(value) }
        |                                        ^^^^^
    195 |       return true
    196 |     })
    197 |   })

Does anybody have a solution yet?

@erfanasbari
Copy link

same

@johnf
Copy link

johnf commented Feb 21, 2023

yup-phone has a dependency on 0.13 of Yup.
So like me you likely have two versions of yup in node-modules. So the new prototype is being added to the old yup.

If you are using yarn you can override the dependency in package.json like so

{
  "resolutions": {
    "yup": "^1.0.0"
  }
}

@Adorabus
Copy link

Adorabus commented Mar 14, 2023

johnf's answer worked for me, thanks!

But I use NPM so a slight change:

{
  {
  "overrides": {
    "yup": "^1.0.0"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants