cerebral / overmind

Overmind - Frictionless state management

Home Page:https://overmindjs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Statemachine errors on send(), possible documentation issue

david-morris opened this issue · comments

https://codesandbox.io/s/overmind-counter-forked-d7o1h?file=/src/index.js

I am using a StateMachine based on what I found in the documentation, and depending on how I try to instantiate it, it will fail when I call send() with either state.send is not a function (if my config includes the state machine as state: refresher.create...) or tree.enableMutations is not a function if I have included the machine in a namespace or a field of state.

I noted that the statemachine guide included useOvermind. Hasn't that been removed? I did check to make sure I was on the Overmind 28 docs.

I should add, this issue still occurs when I use an example statemachine from the statemachine guide.

I've encountered the same issue (and know I have previously encountered it as well, but do not recall the resolution). I have refactored a pre-existing state machine, and this refactoring introduced this bug when running against a mock Overmind instance in a unit test - but not in the live app. I am having a lot of trouble tracking down precisely which change is responsible.