statelyai / xstate

Actor-based state management & orchestration for complex app logic.
https://stately.ai/docs
MIT License
26.51k stars 1.22k forks source link

Bug: [Typescript] `enqueueActions` throws a type error when declared within setup actions #4923

Open andrecrimb opened 1 month ago

andrecrimb commented 1 month ago

XState version

XState version 5

Description

TS throws an error when enqueuedActions is declared within setups > actions.

Expected result

No type error should be raised.

Actual result

Screenshot 2024-05-31 at 11 02 37

Reproduction

Sandbox link

Additional context

xstate: 5.13.0 typescript: "5.3.3

davidkpiano commented 1 month ago

Which TypeScript version are you using?

Regardless this may be a TS limitation (cc. @Andarist)

andrecrimb commented 1 month ago

Sorry, I forgot to add it into the description.
"typescript": "5.3.3"