zodix: [BUG] TypeError: keyValidator._parse is not a function

using separate zod schema doen’t work

πŸš€ ~ action ~ error TypeError: keyValidator._parse is not a function
    at ZodObject._parse (types.js:1188:37)
    at ZodObject._parseSync (types.js:109:29)
    at ZodObject.safeParse (types.js:139:29)
    at ZodObject.parse (types.js:120:29)
    at Object.parseForm (index.js:50:22)
    at async action (main.tsx:25:20)
    at async callLoaderOrAction (router.ts:2530:14)
    at async handleAction (router.ts:981:16)
    at async startNavigation (router.ts:904:26)
    at async Object.navigate (router.ts:784:12)

here the repo for reproduce: zodix-rr-reproduce

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 3
  • Comments: 15 (4 by maintainers)

Most upvoted comments

For future idiots (me), if you miss the () off your rule, you also get this error. e.g.:

const schema = z.object({
	reason: z.string().optional // () missing
})

That makes sense because the dependency resolution would be less error prone that way.

Regardless, I just tested your repro with the v0.3.0 release and it’s working now.