Open dielsalder opened 1 month ago
Is there a reason you need declaration: true
in your tsconfig? Typically this isn't necessary for application code. https://stackoverflow.com/questions/68463963/typescript-the-inferred-type-of-this-node-exceeds-the-maximum-length-the-compi
If you need declaration files for some reason, you may have to tweak the generation code to include explicit type declarations, as the error message says.
If that's not workable, I'm afraid you'll have to wait for Zod 4 which will dramatically simplify a lot of internal type representations. Sorry for not having better news, that error is always a doozy.
Is there a reason you need
declaration: true
in your tsconfig?
Monorepos are: they require composite: true
, which in turn requires declaration: true
.
I work in a monorepo and I don't need composite neither declaration.
In our project, it happens on typescript 5.6.2 but 5.5.4 works fine.
Hi guys. I'm pretty new to Zod. I have a project with some large schemas and I am frequently running into this error:
It seems that it has to do mainly with typescript hitting a hard maximum for schemas of a certain size, as I can trigger it just by adding or removing one property on a schema. Splitting the big schema into multiple variables or files does not help.
Would like to know if there are any good workarounds to this. There has been a past issue but none of the solutions in that thread have helped for me. The only thing I haven't tried is to monkey-patch tsc, but I would like to avoid that.
Thanks!