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

Form/field not found warnings with the latest 4.11.0 useSetFieldValue and useSetFormValues composables #4399

Closed
2 of 5 tasks
ThomasRalee opened this issue Aug 1, 2023 · 3 comments
Labels
🐛 bug Unintended behavior

Comments

@ThomasRalee
Copy link

ThomasRalee commented Aug 1, 2023

What happened?

Testing the new vee-validate composable useSetFieldValue and useSetFormValues resulted in form not detected warning.

Reproduction steps

Added a stackblitz demo with a very simple UI to illustrate the issue

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

image
Untitled

Demo link

https://stackblitz.com/edit/github-9xguag?file=components%2FFormWrapper.vue

Code of Conduct

@ThomasRalee ThomasRalee changed the title <title> Confusing warnings with the latest 4.11.0 useSetFieldValue and useSetFormValues composables Aug 1, 2023
@ThomasRalee ThomasRalee changed the title Confusing warnings with the latest 4.11.0 useSetFieldValue and useSetFormValues composables Form/field not found warnings with the latest 4.11.0 useSetFieldValue and useSetFormValues composables Aug 1, 2023
@logaretm
Copy link
Owner

logaretm commented Aug 2, 2023

This is because the composables only work as children of useForm or useField. I cannot see you called useForm anywhere in the parent component which is what the warning is telling you to do.

I will update the docs soon on that part.

@logaretm logaretm closed this as completed Aug 2, 2023
@ThomasRalee
Copy link
Author

ThomasRalee commented Aug 2, 2023

@logaretm I called it in the app.vue component that wraps around the FormWrapper though 🤔

<script setup lang="ts">
import { useForm } from 'vee-validate';

useForm(); <---
</script>

<template>
  <div>
    <FormWrapper />
  </div>
</template>

@logaretm logaretm added the 🐛 bug Unintended behavior label Aug 3, 2023
@logaretm logaretm reopened this Aug 3, 2023
@logaretm
Copy link
Owner

logaretm commented Aug 3, 2023

You are correct, I missed the app.vue, thanks for the clarification. I will take a look later today.

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

No branches or pull requests

2 participants