xstate-viz
xstate-viz copied to clipboard
Simple machine configuration breaks the visualizer
Description
First off, apologies for the bad title, but I really have no insight into what's not working. Feel free to rename.
My, seemingly simple, machine won't render. It's not a terribly sensible machine, but that's because I reduced it from 182 lines to about 25 to produce a minimum-non-functioning example.
Expected Result
The machine config should render correctly, as it does in the old visualizer:

Actual Result
The new visualizer just hangs on "Visualizing machine...".

With the following console errors:
Chrome

Firefox

Reproduction
Enter the following into stately.ai/viz:
import { createMachine } from "xstate";
createMachine({
id: "Top",
initial: "first",
states: {
first: {
on: { MOVE: "second" },
},
second: {
initial: "firstSubstate",
states: {
firstSubstate: {
on: {
BACK: "#Top.first.",
NEXT: "secondSubstate",
},
},
secondSubstate: {
initial: "subSubState",
states: { subSubState: {} },
},
},
},
},
});
Additional context
Several things seem to "solve" the problem:
- Removing the
BACKtransition

- Removing the
NEXTtranstition

- Removing the
subSubStatefrom thesecondSubstate

- Strangest of all, adding an additional,
thirdSubstatetosecond(line 23)
