-
Notifications
You must be signed in to change notification settings - Fork 525
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
fix(Form): fix valibot imports #617
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thanks for the fix! Got a bit overwhelmed with the release and the rebranding yesterday, I forgot to try this myself 😅 |
because of this issue there are no working versions of nuxt/ui right now, old package (nuxtlabs) cannot be found and the only version published under the nuxt/ui package name is broken, same with edge. will install valibot in the meantime as a workaround |
@ZainW Would you mind sharing a reproduction on StackBlitz of your code and the |
Yeah I'm also experiencing the issue on the latest edge version... I thought that dynamic imports would do the trick but I must have missed something. I'll look into it. |
@ZainW Also, what do you mean old package cannot be found? We deprecated |
This is... not good 😄 experiencing the same. Here is a reproduction with the latest edge installed: |
Maybe you can install the |
Hey @romhml, I managed to make this work without importing |
@jduartea that could do the trick, looks like the only thing safeParseAsync does is call _parse and throw if there's any issue (https://github.com/fabian-hiller/valibot/blob/98ef1ccd4dd3726aa85076c2f0bcb912765ad9c0/library/src/methods/parse/parseAsync.ts#L18), but since the function is private there's no guarantee that it'll stay that way. My solution would be to rollback and provide an example to implement it into your own component. #639 @benjamincanac what do you think? |
Here is an example with a custom component: https://stackblitz.com/edit/nuxt-ui-3ct9hb?file=components%2FBaseForm.vue |
@benjamincanac It work. That's your call, I'd avoid relying on private functions if you ask me, but it should be manageable in this case. |
I agree with you, but in this case all the Also, I don't fell confortable reverting this feature as people started using it already. It's on me for merging the PR too fast and introducing this in |
I really appreciate it solved |
Fixes import errors from valibot in the Form component by importing safeParseAsync dynamically.