nuxt-xstate icon indicating copy to clipboard operation
nuxt-xstate copied to clipboard

bug: nuxt bridge minimal implementation not working

Open Lexpeartha opened this issue 2 years ago • 2 comments

Your Environment

All Nuxt Bridge projects with minimal option enabled

Reproduction

No response

Describe the bug

I think the non fms gets imported on accident somehow, which makes the state machine defined with fms implementation incompatible with the type, and also throws an error at runtime. Requires closer inspecting, since I wasn't able to find actual issue in autoImports.ts so far

Additional context

Throws the following type error: Argument of type 'Machine<object, EventObject, { value: any; context: object; }>' is not assignable to parameter of type 'MaybeLazy<StateMachine<object, any, EventObject, { value: any; context: object; }, BaseActionObject, ServiceMap, ResolveTypegenMeta<TypegenDisabled, EventObject, BaseActionObject, ServiceMap>>>'

Lexpeartha avatar Oct 01 '22 21:10 Lexpeartha

Workaround is to manually import createMachine from xstate-vue2/lib/fsm, where needed, which should override faulty auto-import

Lexpeartha avatar Oct 10 '22 17:10 Lexpeartha

This might've been fixed in #30, although I'm not sure If someone could test it out and tell the results here, it would be immensely helpful 👍🏽

Lexpeartha avatar Dec 05 '22 20:12 Lexpeartha