Skip to content

[v5] tsserver hangs on generated Toast/Modal components; occasionally reveals TS2589 "excessively deep" on createAnimatedComponent #3438

Description

@n-ii-ma

Description

Opening or hovering in generated components/ui/toast/index.tsx or components/ui/modal/index.tsx causes VSCode's tsserver to hang indefinitely ("Loading..." on hover, never resolves without a TS server restart).
Running tsc --noEmit on the project takes 200+ seconds, almost entirely spent checking these two files.
Removing both files from the project restores normal IntelliSense/type-check speed immediately; re-adding either one reproduces the hang.

Diagnostics

tsc --noEmit --diagnostics on the full project:

Files: 1417
Lines: 197579
Identifiers: 162140
Symbols: 518751
Types: 3199353
Instantiations: 15461885
Memory used: 1496168K
Check time: 201.13s
Total time: 201.77s

analyze-trace hot spots (via tsc --generateTrace +
@typescript/analyze-trace):

├─ Check file components/ui/toast/index.tsx (161263ms)
│ └─ Check expression styled(AnimatedView, { className: 'style' }) (161234ms)
└─ Check file components/ui/modal/index.tsx (11525ms)
└─ Check expression styled(AnimatedPressable, { className: 'style' }) (11482ms)

Additionally, VSCode reports directly on these two lines in modal/index.tsx:

const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
const AnimatedView = Animated.createAnimatedComponent(View);

TS2589: Type instantiation is excessively deep and possibly infinite.

Environment

  • typescript: 6.0.3
  • react: 19.2.3
  • react-native: 0.86.0
  • react-native-reanimated: 4.5.0
  • @gluestack-ui/core: 5.0.15
  • @gluestack-ui/utils: 5.0.6
  • nativewind: 5.0.0-preview.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions