XState VSCode extension - Visual Editor shows unexpected errors when using multiple guarded transitions
soc221b opened this issue · comments
Version
xstate@5.0.0-beta.33
XState VSCode v2.0.0
Reproduce
- Go to https://stately.ai/docs/guards#multiple-guarded-transitions, there is an example for multiple guarded transitions.
- Paste the following code in VSCode editor:
const feedbackMachine = createMachine({ /** @xstate-layout N4IgpgJg5mDOIC5QAoC2BDAxgCwJYDswBKAOgAcAnAe1TIBcBiAMzEgCMsBrc6gN1whgA2gAYAuolBkqsXHVxV8kkAA9EARgCsADhIA2ACwi9AJk0AaEAE9E29SU0BfR5bRY8hUpRr1mrCByY3N78gkLqEkgg0rLyispqCFq6hsZmljZJ2iYOzq4YOATEPD6MLOxcJaHCJpFSMnIKSlGJyfpGphbWGgDMJs4uIPhUgvBRboWeyjGN8S2IALR6GYt6eSATHsXetHTTDXHNoIkGJitJAOw9JD0XToObRaR02Oj4nGP1sU0JiAamJA66W6CGy60enhITCoFFQ+2+c2OfwBQK6mXUdxIdwGjiAA */ initial: 'prompt', states: { prompt: { on: { 'feedback.provide': [ // Taken if 'sentimentGood' guard evaluates to `true` { guard: 'sentimentGood', target: 'thanks', }, // Taken if none of the above guarded transitions are taken // and if 'sentimentBad' guard evaluates to `true` { guard: 'sentimentBad', target: 'form', }, // Default transition { target: 'form' }, ], }, }, thanks: {}, form: {}, }, })
Actual
![image](https://user-images.githubusercontent.com/22850435/273789552-f62906ad-afcb-48b0-bf34-3644ab05c8ef.png)
Expected
No error occurs
Thank you for the report; we're investigating this.