statelyai / xstate

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

Bug: Type Error with Actions outside of Setup() #4846

Open mbushpilot2b opened 5 months ago

mbushpilot2b commented 5 months ago

XState version

XState version 5

Description

Defining actions outside of the setup() results in a type error.

Expected result

Actions defined outside the setup should not throw typescript error.

Actual result

Typescript error as seen here: Screenshot 2024-04-10 at 11 25 31 PM

Reproduction

https://stackblitz.com/edit/node-c2qnkr?file=index.ts

Additional context

See discord conversation here for context.