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

Property defineField does not exist in useForm() #4711

Closed
2 of 5 tasks
ahmaruff opened this issue Mar 25, 2024 · 2 comments
Closed
2 of 5 tasks

Property defineField does not exist in useForm() #4711

ahmaruff opened this issue Mar 25, 2024 · 2 comments

Comments

@ahmaruff
Copy link

ahmaruff commented Mar 25, 2024

What happened?

I use nuxt3 and install vee-validate with pnpm add @veevalidate/nuxt

I want to use Composition API (because I use 3rd party UI library). and I following example in https://vee-validate.logaretm.com/v4/.

when i try to use defineField,

const {values, defineField} = useForm();

it return error

Property 'defineField' does not exist on type 'FormContext<GenericObject, GenericObject>'.

can somebody explain why?

Reproduction steps

  1. install vee-validate
  2. create pages
  3. write const {values, defineField} = useForm();
    ...

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

[{
	"resource": "/home/ahmaruff/work/waktoo/fe/ecomm-fe/.app/pages/auth/login.vue",
	"owner": "_generated_diagnostic_collection_name_#0",
	"code": "2339",
	"severity": 8,
	"message": "Property 'defineField' does not exist on type 'FormContext<GenericObject, GenericObject>'.",
	"source": "ts",
	"startLineNumber": 14,
	"startColumn": 9,
	"endLineNumber": 14,
	"endColumn": 20
}]

Demo link

Code of Conduct

@AidosMarcos
Copy link

AidosMarcos commented May 7, 2024

Having the same problem. @logaretm

On "vee-validate": "4.6.7",

Also using Nuxt3 with Vuetify.

Following vee-validate composition api documentation.
Can't use defineField when const '{ errors, handleSubmit, defineField } = useForm();'

UPDATE:
I fixed this by update "vee-validate" to v 4.12.7. @ahmaruff

@logaretm
Copy link
Owner

logaretm commented May 9, 2024

Depends on the release version, thanks @AidosMarcos for the update.

@logaretm logaretm closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2024
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

3 participants