When creating a self-referencing transition (e.g., stateA --> stateA) in a stateDiagram-v2, the diagram fails to render and throws a TypeError: 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:
stateDiagram-v2
[*] --> Draft: Save as Draft
Draft --> PendingInternalApproval: Submit
Draft --> Draft: update on draft
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:
TypeError: Cannot read properties of undefined (reading 'node')
Notice that the diagram fails to render, and the self-referencing transition (Draft --> Draft) causes the error.
Screenshots
Code Sample
stateDiagram-v2
[*] --> Draft: Save as Draft
Draft --> PendingInternalApproval: Submit
Draft --> Draft: update on draft
Setup
Mermaid version: Web UI
Browser and Version: Chrome: Version 127.0.6533.101 (Official Build) (arm64)
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