vantezzen / auto-form

🌟 A React component that automatically creates a @shadcn/ui form based on a zod schema.
https://vantezzen.github.io/auto-form/
2.27k stars 81 forks source link

array of objects with .optional fails with Uncaught TypeError: Cannot read properties of undefined (reading '_def') #37

Open krisgrm opened 8 months ago

krisgrm commented 8 months ago

example:

    failSchema: z.array(z.object({
           ...
          }),
      )
      .optional()
rossanmol commented 8 months ago

Also breaks when setting default, with same error.

mo6zes commented 7 months ago

@vantezzen @rossanmol @krisgrm Did you find a workaround? I am trying to set a default for

 z.array(z.object({
           ...
})
younes200 commented 6 months ago

same with .partial()