Closed K3TH3R closed 2 years ago
@xstate/vue@1.x
doesn't support machines with typegen and we can't do much to fix that. A package consuming a machine must declare explicitly what it wants to do with the typegen stuff in its definition - it can either utilize the typegen information or just accept any
at that position but the choice has to be explicit.
No worries though because I've just prepared a PR adding the typegen support to @xstate/vue
: https://github.com/statelyai/xstate/pull/3083
Okay, thank you @Andarist.
Description
I have the following machine, which throws no Typescript errors on XState 4.23.4:
Expected result
I expected to be able to upgrade my machine as-is without encountering new Typescript errors.
Actual result
Upon upgrading to
4.30.2
, with no other changes to my machine, I start seeing the following lines highlighted with errors:If I add the
tsTypes: {}
line to generate the typegen file, the error on my actions disappear, but I'm still seeing the following errors:const appService = useInterpret(appMachine)
provide(appMachineKey, appService)
Reproduction
https://codesandbox.io/s/vue-typegen-issues-ty4k8r?file=/src/App.machine.ts
Additional context