#6402·mermaid

Reverse arrows <-- not supported in flowchart

Author: nourhentaCreated Mar 22, 2025Updated Sep 12, 2026
LabelsType: Bug / ErrorType: EnhancementContributor neededStatus: ApprovedGraph: Flow

Description

Using a reverse arrow (<--) in a Mermaid flowchart diagram leads to a cryptic syntax error. Many users may naturally assume B <-- C is valid, expecting it to behave like C --> B, especially since reverse arrows are supported in other graphing tools.

Instead of a helpful explanation, Mermaid throws the following error:

Expecting 'LINK', 'UNICODE_TEXT', 'EDGE_TEXT', got '1'

This behavior is confusing and not well-documented. Either the syntax should be supported, or Mermaid should provide a more descriptive error message.

Steps to reproduce

  1. Go to https://mermaid.live/
  2. Paste the following code in the editor:
flowchart TD
  A --> B
  B <-- C
  1. Notice the syntax error thrown: Expecting 'LINK', 'UNICODE_TEXT', 'EDGE_TEXT', got '1'

Screenshots

Code Sample

Setup

  • Mermaid Version: v11.5.0 (tested on Mermaid Live Editor)
  • Browser: Chrome v122
  • Platform: Windows 11

Suggested Solutions

  • Add support for B <-- C syntax and internally convert it to C --> B.

  • Improve error messaging for unsupported arrow syntax. Instead of a cryptic parser error, show: "Reverse arrows (<--) are not currently supported. Try writing C --> B instead."

Additional Context

No response