medv ❄
medv ❄15mo ago

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:
No description
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 🤔
Jump to solution
3 Replies
medv ❄
medv ❄OP15mo ago
trpc.io sandbox as expected is not optional:
medv ❄
medv ❄OP15mo ago
No description
Solution
medv ❄
medv ❄15mo ago
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 🤔