Got "Maximum call stack size exceeded" when checking validity of types when using zid
Hi, I recently came across this error, and after narrowing down which parts it was from, one instance was when I imported and used zid from within my nextjs project. But I am not exactly sure why this happens in this project as I managed to import zid without any issue in other nextjs projects. I am still debugging it and I am sure there is something else which is the issue but just wondering if you guys have seen anything similar and can give some clues.
18 Replies
Do you mean zod? I haven’t had any issues like this with it so far. Happy to look at offending code if you can share any.
zid from convex-helpers
Ah, gotcha - so if you import without using or referencing, that’s enough to trigger the error?
Import + use it in nextjs app. This usually works (did this before in other projects) but it doesnt for this particular project.
Just trying to understand the repro case - importing alone doesn’t do it, but usage does. Is it specific usage? If you use it once in a simplistic way, does it throw?
Trying to narrow down potential cause, since it’s not happening elsewhere
it only fails in one particular repo of mine
it is a bit hard to explain, i can add you to the repo if you want to take a look\
I’m up for that - I’m mobile right now but can take a look in the am
sure, whats your github username?
Same as here, erquhart
I managed to create a drastically simpler repro: just run tsc --noEmit and you will see the error. Remove the zid import and you will be able to tsc with no error.
the error shows up as long as you import anything at all from convex-helpers
Yeah importing anything from convex helpers blows the stack, and the errors aren't even consistent. Same result using either bun or npm.
Strict mode isn't causing it
Question: why no tsconfig in your convex directory?
@ian maybe take a look at this repro ^ since it's convex-helpers related
I'm not sure I'd expect this to work with no convex specific tsconfig, it's all going off of the root config. It looks like most properties are included there, but the other settings could be causing issues.
_generated
should be excluded and isn't, but addressing that didn't fix the issue.Try installing typescript@5.3
The newest version of typescript seems to be failing- I just noticed it yesterday and haven’t root caused it
Yep, that seems to fix it
convex-helpers version 0.1.26 works with
typescript@5.4
now @milk enjoyer 🎉Awesome thanks!