Skip to content

New error: Type instantiation is excessively deep and possibly infinite. #37613

Open
@amcasey

Description

@amcasey

This one's actually new in 3.8. There are some additional errors in 3.9 - I'll post them below.

https://github.com/davidkpiano/xstate/blob/2e0bd5dcb11c8ffc5bfc9fba1d3c66fb7546c4bd/packages/core/src/stateUtils.ts#L157

packages/core/src/stateUtils.ts:157:36 - error TS2589: Type instantiation is excessively deep and possibly infinite.

157   return getValueFromAdj(rootNode, getAdjList(config));
                                       ~~~~~~~~~~~~~~~~~~

packages/core/src/State.ts:181:12 - error TS2589: Type instantiation is excessively deep and possibly infinite.

181     return new State(config);
               ~~~~~~~~~~~~~~~~~

packages/core/src/interpreter.ts:208:5 - error TS2589: Type instantiation is excessively deep and possibly infinite.

208     this.parent = parent;
        ~~~~~~~~~~~~~~~~~~~~

packages/core/src/interpreter.ts:783:13 - error TS2345: Argument of type '{ type: string; data: any; }' is not assignable to parameter of type 'string | EventObject | Event<EventObject>[] | Event<EventObject>'.
  Object literal may only specify known properties, and 'data' does not exist in type 'EventObject'.

783             data: err
                ~~~~~~~~~

To repro:

  1. yarn
  2. tsc -b -f tsconfig.monorepo.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs InvestigationThis issue needs a team member to investigate its status.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions