Rispy
Rispy•13mo ago

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
jamwt
jamwt•13mo ago
is this an error message?
Rispy
RispyOP•13mo ago
No description
Rispy
RispyOP•13mo ago
yes also ts type of internal and api is broken and doesn't work
ballingt
ballingt•13mo ago
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 TypeScript
Rispy
RispyOP•13mo ago
oh I see in api.d.ts was broken imports I delete them and rerun npx covex dev and now is fixed 🙂
ballingt
ballingt•13mo ago
api.d.ts should be automatically deleted and replaced whenever you modify files in the convex directory if you have npx convex dev running
erquhart
erquhart•13mo ago
I'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.

Did you find this page helpful?