#Got "Maximum call stack size exceeded" when checking validity of types when using zid

23 messages · Page 1 of 1 (latest)

topaz iron
#

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.

pure yarrow
#

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.

pure yarrow
#

Ah, gotcha - so if you import without using or referencing, that’s enough to trigger the error?

topaz iron
#

Import + use it in nextjs app. This usually works (did this before in other projects) but it doesnt for this particular project.

pure yarrow
#

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

topaz iron
#

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\

pure yarrow
#

I’m up for that - I’m mobile right now but can take a look in the am

topaz iron
#

sure, whats your github username?

pure yarrow
#

Same as here, erquhart

topaz iron
#

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

pure yarrow
#

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?

rustic igloo
#

@sharp raft maybe take a look at this repro ^ since it's convex-helpers related

pure yarrow
#

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.

sharp raft
#

The newest version of typescript seems to be failing- I just noticed it yesterday and haven’t root caused it

pure yarrow
#

Yep, that seems to fix it

sharp raft