Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: machine with unconventional targets can be imported/exported but breaks editor #218

Open
josephfh opened this issue Jan 18, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@josephfh
Copy link

XState version

XState version 5

Description

As title. Console error message from the editor:

_app-af856e1a62dd54fe.js?dpl=dpl_GWbyzzohyQsejJrC4Mqt46f2wrhK:615 Error: org.eclipse.elk.core.UnsupportedGraphException: The source or the target of edge ElkEdge "target-i8av66y1sqc" ElkNode "i8av66y1sqc" (0,0 | 157.8559079094802,89.06250574191411) -> ElkNode "5se3sw28mdg" (0,0 | 0,0) could not be found. This usually happens when an edge connects a node laid out by ELK Layered to a node in another level of hierarchy laid out by either another instance of ELK Layered or another layout algorithm alltogether. The former can be solved by setting the hierarchyHandling option to INCLUDE_CHILDREN.

Expected result

A warning about incorrectly targeted nodes

Actual result

No visualisation, console log error

Reproduction

https://stackblitz.com/edit/github-phuuwz?file=src%2FfeedbackMachine.ts

Additional context

No response

@josephfh josephfh added the bug Something isn't working label Jan 18, 2024
@davidkpiano
Copy link
Member

Very strange. I'll look into it; thank you for the report.

@josephfh
Copy link
Author

Seems to be trying to target the machine itself on a target. This doesn't work:

      on: {
        'search.clearTerm': {
          target: '#search',
        },

This might well be an invalid way to specify a target that happens to work in XState but breaks the viz

But if I specify the initial state of the machine, it works:

      on: {
        'search.clearTerm': {
          target: '#search.starting',
        },

@davidkpiano davidkpiano transferred this issue from statelyai/xstate Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants