Messages from zod input validation doesnt work with react compiler. NextJS. #4030
krystianmolas
started this conversation in
General
Replies: 1 comment 1 reply
-
I believe this has to do with the usage of ui/apps/www/registry/new-york/ui/form.tsx Lines 47 to 49 in 259a9ff If The solution I'm currently using is to swap both those lines with: // import useController along with the rest of the hook-form imports
const { fieldState } = useController({ name: fieldContext.name }) I don't know how ideal this is compared to whatever fix will end up being merged, but it seems to work for me. As an escape hatch for any other potential issues there is also |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm encountering an issue with displaying validation messages in a basic input form using Zod for validation, as documented here: https://ui.shadcn.com/docs/components/input. This setup worked in previous projects, but in my current project, which utilizes the experimental React compiler, the validation messages fail to appear. When I disable the React compiler by commenting out the following configuration:
experimental: { reactCompiler: true, }
the validation messages display correctly. Has anyone experienced a similar issue, or could this be a bug related to the experimental React compiler?
Beta Was this translation helpful? Give feedback.
All reactions