Description
Summary
When running tsgo
on a project that uses @sinclair/typebox
and mongoose
, I receive type errors related to excessive stack depth and circular type references — even though the same project compiles cleanly with tsc
.
This suggests that tsgo
may be missing optimizations or recursion-handling logic that tsc
uses for these common libraries.
Errors
tsgo -p . --extendedDiagnostics
node_modules/@sinclair/typebox/typebox.d.ts:137:63 - error TS2321: Excessive stack depth comparing types 'UnionToTuple<...>' and 'TSchema[]'.
node_modules/@sinclair/typebox/typebox.d.ts:145:63 - error TS2321: Excessive stack depth comparing types 'UnionToTuple<...>' and 'TSchema[]'.
node_modules/@sinclair/typebox/typebox.d.ts:380:102 - error TS2321: Excessive stack depth comparing types 'UnionToTuple<...>' and 'TLiteral[]'.
node_modules/mongoose/types/inferschematype.d.ts:245:51 - error TS4109: Type arguments for 'Schema' circularly reference themselves.
node_modules/mongoose/types/inferschematype.d.ts:265:53 - error TS4109: Type arguments for 'Schema' circularly reference themselves.
These errors do not appear when running
tsc -p . --extendedDiagnostics