statelyai / xstate

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

Bug: [Typescript] EventFrom helper type returning `never` since 5.17.0 #5031

Closed taraldr closed 3 months ago

taraldr commented 3 months ago

XState version

XState version 5

Description

EventFrom and ContextFrom utilities appear to have stopped working since 5.17.0, always returning never when being passed the typeof a machine.

Expected result

Expected non-never.

Actual result

Got never.

Reproduction

https://stackblitz.com/edit/vitejs-vite-qubngj?file=src%2Fmain.ts&view=editor

Additional context

No response

davidkpiano commented 3 months ago

Quick workaround for events: use EventFromLogic instead of EventFrom

Investigating this 🔍