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

.label() method is not available with zod #4708

Open
1 of 5 tasks
madebyfabian opened this issue Mar 21, 2024 · 0 comments
Open
1 of 5 tasks

.label() method is not available with zod #4708

madebyfabian opened this issue Mar 21, 2024 · 0 comments

Comments

@madebyfabian
Copy link

What happened?

Hi there! When I want to use the zod schema declaration to add a custom label to it (with z.string().label('My label')) like in the docs https://vee-validate.logaretm.com/v4/guide/composition-api/custom-inputs#custom-field-labels, it errors:

Property label does not exist on type 'ZodString'

Reproduction steps

  1. Install latest versions of zod@3.22.4, @vee-validate/zod@4.12.6 and vee-validate@4.12.6
  2. Create a schema:
const schema = z.object({
  title: z.string().min(1).label('My label'),
})
  1. Get the type error I listed above + a runtime error (page throws with HTTP 500)

Version

Vue.js 3.x and vee-validate 4.x

What browsers are you seeing the problem on?

  • Firefox
  • Chrome
  • Safari
  • Microsoft Edge

Relevant log output

No response

Demo link

Can be provided if needed

Code of Conduct

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

1 participant