Skip to content

tsgo reports deep type errors in @sinclair/typebox and mongoose that tsc handles without issue #948

Closed
@CarlOfHoly

Description

@CarlOfHoly

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: Type CheckingRelated to type checking, grammar checkingduplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions