Issue with Self-Referencing Transitions in stateDiagram-v2 Causing TypeError: Cannot read properties of undefined (reading 'node') #5822
Labels
Status: Triage
Needs to be verified, categorized, etc
Type: Bug / Error
Something isn't working or is incorrect
Description
Description
When creating a self-referencing transition (e.g.,
stateA --> stateA
) in astateDiagram-v2
, the diagram fails to render and throws aTypeError: Cannot read properties of undefined (reading 'node')
. This issue seems to be specific to self-referencing transitions in version 2 of the state diagram.Expected Behavior
The diagram should render correctly with a self-referencing transition, visually representing the state transition from
stateA
back to itself.Actual Behavior
The diagram fails to render and throws the following error in the console:
Steps to reproduce
Create a
stateDiagram-v2
with the following content:Render this diagram in a Mermaid-compatible environment (such as a browser, markdown editor, or code editor supporting Mermaid.js).
Check the browser console for the error:
Notice that the diagram fails to render, and the self-referencing transition (
Draft --> Draft
) causes the error.Screenshots
Code Sample
Setup
Suggested Solutions
No response
Additional Context
It was working about a week or 15 days ago
The text was updated successfully, but these errors were encountered: