You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type instantiation is excessively deep and possibly infinite.ts(2589)
Expression produces a union type that is too complex to represent.ts(2590)
Most weirdly, while it does error out, it actually still correctly infers the type!
I also tried simplifying the function declaration. Avoiding my types (Return and GPTFunction), and replacing them with their applications directly doesn't change the error.
This works, but it's not what I need unfortunately:
I already had this issue in other libs. This is some TS internals dark magic that I don't understand anything about, but it will work if you use a second unconstrained generic like this:
I was trying to come up with a way to describe GPT functions, along with the name and description:
But then this doesn't work:
It errors out with:
Most weirdly, while it does error out, it actually still correctly infers the type!
I also tried simplifying the function declaration. Avoiding my types (Return and GPTFunction), and replacing them with their applications directly doesn't change the error.
This works, but it's not what I need unfortunately:
Another attempt that doesn't work, and it's actually quite a simple thing:
No custom types, very simple generic... still I get, even without ever calling this, for "return":
What do I miss? Did I misconfigure something, or is there a different ways to use generics here?
The text was updated successfully, but these errors were encountered: