statelyai / studio-issues

Report issues found in Stately Studio
5 stars 0 forks source link

Typegen doesn't generate types for actions when the XState v4 machine is exported from the Editor #180

Open Osky772 opened 1 year ago

Osky772 commented 1 year ago

Studio version: 0.60.0 XState version: 4.38.2

Exported machine has actions syntax like

{
  "target": "fetchingPage",
  "actions": {
    "type": "assignCurrentPage",
    "params": {}
  }
}

and this syntax is the problem for Typegen - the types are not generated.

From the typegen file

  eventsCausingActions: {};

But when I switch to syntax

{
  "target": "fetchingPage",
  "actions": "assignCurrentPage"
}

everything works fine.

This issue makes it impossible to import machine from code and then export it back to the project for XState v4 with typegen

davidkpiano commented 1 year ago

Seems like this may be a problem with the machine extractor (cc. @farskid @Andarist)