Type instantiation is excessively deep and possibly infinite
I run into this issue but don't know why and frustraing me kinda. :sadKek:
7 Replies
is this an error message?
yes
also ts type of internal and api is broken and doesn't work
If you cmd-click on this
internal
variable does it take you to the api.d.ts
file and can you see anything else in there underlined in red?
Often this is caused by a file in the Convex folder not being valid TypeScriptoh I see in api.d.ts was broken imports I delete them and rerun npx covex dev and now is fixed 🙂
api.d.ts should be automatically deleted and replaced whenever you modify files in the convex directory if you have
npx convex dev
runningI've found that this error happens when there are other seemingly unrelated type errors. If you have the convex dev server running and address all of the other errors being reported, this should resolve itself through regeneration.
The other case I've seen is when I write a convex function where the function output is too convoluted. In this case I try to refactor the function to ensure types are flowing through properly, or else define the return type explicitly.