TS(7056) Error - The inferred type of this node exceeds the maximum length the compiler will serialize.

Cause

This error happens mostly when you’re putting a lot of schemas and other types into the same namespace. Or you're using too many type inference on block scope.

Solution

So, you should write on some explicit type for each type inference, especially return type of code. Then, this error will be disappear.