Giter VIP home page Giter VIP logo

Comments (6)

wKovacs64 avatar wKovacs64 commented on July 21, 2024 1

For those following along at home, it worked!

from xstate-tools.

wKovacs64 avatar wKovacs64 commented on July 21, 2024

Someone in Discord pointed out that inlining the guards makes the error go away. Unfortunately, doing that prevents you from using the visual editor.

from xstate-tools.

Andarist avatar Andarist commented on July 21, 2024

Huh, inlining a guard vs referencing a guard should definitely not result in such a behavior difference. This is definitely a bug - and most likely in XState itself

from xstate-tools.

wKovacs64 avatar wKovacs64 commented on July 21, 2024

Huh, inlining a guard vs referencing a guard should definitely not result in such a behavior difference. This is definitely a bug - and most likely in XState itself

To be clear, the machine executes properly at runtime regardless of where the guard is defined. It seems the VSCode extension just can't handle cyclic always transitions and for some reason inlining the guard prevents the maximum callstack exceeded error (but inlining the guard might just be causing the extension to fail/abort parsing the machine before the error can happen?).

from xstate-tools.

mattpocock avatar mattpocock commented on July 21, 2024

Found a fix for this. XState was erroring too soon when you didn't provide a guard that was checked as part of an initial state. So we extract a bunch of 'guards to mock' from the machine definition.

By default, we were setting these guards as () => true. But we don't need to. Setting them as () => false works.

from xstate-tools.

mattpocock avatar mattpocock commented on July 21, 2024

(reopening pending @wKovacs64 feedback on a version distributed privately)

from xstate-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.