-
Notifications
You must be signed in to change notification settings - Fork 296
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
[Bug]: Vee-validate fails when auto importing Form component #172
Comments
Thanks for the report this because Only And I export vee-validate Will check it |
For now install https://vee-validate.logaretm.com/v4/integrations/nuxt/ And change |
Thanks for the feedback @sadeghbarati! 💪 Just manually importing the form like this also works perfectly for now. 😃 import {
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
FormMessage,
} from '@/components/ui/form' |
@sadeghbarati Im thinking of instead of importing component based on Thus would eliminate the issue whereby some component wasn't imported such in this case, as well as Pagination. |
That's good idea https://stackblitz.com/edit/github-xkryhq?file=nuxt.config.ts,.nuxt%2Fcomponents.d.ts Another Stackblitz using Nuxt modules I made PR to Nuxt to add prepend (unshift) opt to But we have to add a warning about not adding |
/cc @DamianGlowala sry for mentioning, I could not find a solution for this problem so I though it's better to ask a Nuxter Please first look at these links
Some of the components don't need to be wrapped in another Vue component, for example in Form we just export The problem is Nuxt can't scan those components that are exported inside
|
Will be fix by #196 |
You can now use shadcn-nuxt module to autoImport the component correctly. |
latest nuxt + shadcn from today... copied code from docs -> failed. imported manually - works. @zernonia |
Environment
Link to minimal reproduction
https://stackblitz.com/edit/nuxt-starter-bsx2ja?file=nuxt.config.ts
Steps to reproduce
You only have to run the project.
Describe the bug
Cannot destructure property 'componentField' of 'undefined' as it is undefined.
This is caused by Vee-Validate being used in the Form component. It only happens when the Form components are automatically imported. The Form works perfectly if you manually import the Form components.
Expected behavior
No error is being thrown.
Conext & Screenshots (if applicable)
The text was updated successfully, but these errors were encountered: