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

can't self-pointing with an arrow to a same node in version 11.1.0 #5820

Open
FeddyLix17 opened this issue Sep 5, 2024 · 5 comments
Open
Assignees
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@FeddyLix17
Copy link

Description

From the version 11.1.0 up to v11.1.0+bfc4abe (the latest at the moment i'm writing) when you try to self pointing with an arrow to the same node it get the following error


Unable to render rich display

Cannot read properties of undefined (reading 'node')

For more information, see https://docs.github.com/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams#creating-mermaid-diagrams


using any version before 11.1.0 doesn't reproduce this behaviour

Steps to reproduce

reproduce the bug

graph LR

A --> A

normal behaviour

graph LR

A --> B

Screenshots

image

Code Sample

No response

Setup

No response

Suggested Solutions

No response

Additional Context

No response

@FeddyLix17 FeddyLix17 added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Sep 5, 2024
@0xcaffebabe
Copy link

StateDiagram has same problem

@razterizer
Copy link

razterizer commented Sep 6, 2024

Yep. I got the same problem when the Mermaid Chart plugin in VSCode was updated this morning.
image
Meanwhile, I'll just add a helper node A --> |action| AH --> A as a cheapo hack to make self-referral "work again".

@ashishjain0512
Copy link
Collaborator

We can reproduce this and are working on a fix for it in the upcoming release.
@knsv

sander added a commit to sander/scal3 that referenced this issue Sep 8, 2024
Workaround this issue that affects GitHub as of 2024-09-08:
mermaid-js/mermaid#5820
sander added a commit to sander/scal3 that referenced this issue Sep 8, 2024
Workaround this issue that affects GitHub as of 2024-09-08:
mermaid-js/mermaid#5820
sander-cb pushed a commit to cleverbase/scal3 that referenced this issue Sep 8, 2024
Workaround this issue that affects GitHub as of 2024-09-08:
mermaid-js/mermaid#5820
@FeddyLix17
Copy link
Author

@knsv huge thanks for the fix!

i just wanna let you know that now the arrows towards the same node are much wider (i don't know if it was intentional).

graph LR;
    A((A))--test -->A((A))

    B((B))-- another test-->B((B))

    C((C))-- text-->C((C))
    C((C))-- another text-->D((D))


Loading

@M-casado
Copy link

Hi there @knsv, thanks for the fix as well! Now diagrams with self-references render, but I encounter similar issues as @FeddyLix17: the arrows for self-references are way off:

  • Screenshot
    image
    ZA -->|Enters periodic\nreview cycle| ZA
  • Rendered in Mermaid.live
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

6 participants