Zod.enum makes my tRPC explode
I'm having an issue with what appears to be circular dependencies. My problem is that I'm not sure what is being parsed that is causing the issue. I don't see a circular dependency. I think that the error message is not indicating the problem line correctly, as I just added more debug to the file and the error message didn't change.
Is there a way to switch on more debug logging in v10 on the server side, so that I can see what's happening more?
The error message:
⨯ TypeError: Cannot read properties of undefined (reading 'parseAsync')
at getParseFn (file:///C:/repos/automation/automate/node_modules/@trpc/server/dist/index.mjs:190:23)
at Object.input (file:///C:/repos/automation/automate/node_modules/@trpc/server/dist/index.mjs:357:28)
at eval (webpack-internal:///(api)/./src/server/api/routers/usbDeviceControl.ts:20:79)
The marker for that last line doesn't seem to change with the content of the file.
How do I go about finding what's undefined here?
1 Reply
This is not a circular dependency issue. It's a z.enum issue.
I have:
This is used as an output validator for a tRPC call to add work to a queue. If I switch the z.string to the z.enum, it kerplodes with the error messages above.