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
I get the "TS2589: Type instantiation is excessively deep and possibly infinite" types error when I run yarn lint on our nodejs project.
The function that encounters it is: updatedBuilder = match(argMatchOrCombination) .with({ operator: "EQ" }, am => updatedBuilder.equals(am)) // Some more with chaining .with({ argName: __.string }, am => updatedBuilder.equals(am as ArgMatch<TArgs>)) .otherwise(() => { throw new Error(); }) ;
Prior to the above code execution, we are having another match-with block to initialize the value for the updatedBuilder where we don't encounter any error: let updatedBuilder = match(initialArgs) .with({ operation: "AND" }, { operation: undefined }, () => inputBuilder.and()) // Some more with chaining .exhaustive();
I could not find any solution to resolve it. Using TS (5.0.4). Kindly suggest some solution. Other solution found was to simplify this part.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I get the "TS2589: Type instantiation is excessively deep and possibly infinite" types error when I run yarn lint on our nodejs project.
The function that encounters it is:
updatedBuilder = match(argMatchOrCombination) .with({ operator: "EQ" }, am => updatedBuilder.equals(am)) // Some more with chaining .with({ argName: __.string }, am => updatedBuilder.equals(am as ArgMatch<TArgs>)) .otherwise(() => { throw new Error(); }) ;
Prior to the above code execution, we are having another match-with block to initialize the value for the updatedBuilder where we don't encounter any error:
let updatedBuilder = match(initialArgs) .with({ operation: "AND" }, { operation: undefined }, () => inputBuilder.and()) // Some more with chaining .exhaustive();
I could not find any solution to resolve it. Using TS (5.0.4). Kindly suggest some solution.
Other solution found was to simplify this part.
Beta Was this translation helpful? Give feedback.
All reactions