statelyai / xstate-viz

Visualizer for XState machines
https://stately.ai/viz
MIT License
433 stars 102 forks source link

Application error on certain invalid configurations #254

Open jeroenverfallie opened 3 years ago

jeroenverfallie commented 3 years ago

Stumbled upon a full nextjs 'Application crash' while writing an invalid machine config.

Reproduction case:

createMachine({
    id: "application error",
    initial: "loading",
    states: {
        loading: {
            entry: {
                target: "list"
            }
        },
        list: {}
    }
})

Crashes immediately on edit, even before hitting Visualize. The crash persist after refresh, so you are forced to either clear the application storage, or quickly change the editor before it triggers.

image

nobrayner commented 2 years ago

I've encountered something similar, except for me it was when I saved machine with a target to a missing state (was about to add it).

Repro link: https://stately.ai/viz/8b20be22-3792-40f8-92e1-6761fae625bb