procedure.input(z.object) is inferred as a partial (optional fields)?
Have a strange case of my input types coming through as partial in procedures, cannot replicate in trpc.io sandbox, any ideas why this might be happening? If I make it a simple
input(z.string())
it is of type string
, but z.object()
properties come through as optional:Solution:Jump to solution
Found the answer, this is an issue with tsconfig missing
strict: true
. Mine was set to strict, but apparently my nx integrated repo was not parsing the chain of extended configs correctly, so this small issue was just a symptom of a larger one. Zod just validated my environment 🤔3 Replies
trpc.io sandbox as expected is not optional:
Solution
Found the answer, this is an issue with tsconfig missing
strict: true
. Mine was set to strict, but apparently my nx integrated repo was not parsing the chain of extended configs correctly, so this small issue was just a symptom of a larger one. Zod just validated my environment 🤔