← Back to editor

Mermaid error

A single dash is not a flowchart arrow

Reproduced on Mermaid 11.17.2 · Updated

A single dash is not a flowchart arrow in Mermaid. The exact parser message, why it happens, and corrected source that renders.

What Mermaid says

Parse error on line 2:
flowchart TD  A -> B
----------------^
Expecting 'SEMI', 'NEWLINE', 'EOF', 'AMP', 'START_LINK', 'LINK', 'LINK_ID', got 'MINUS'

Why it happens

The flowchart link needs at least two dashes. A single dash followed by a greater-than sign is not a link token, so the parser sees two nodes with nothing between them.

The source that fails

flowchart TD
  A -> B

How to fix it

Write the link with two dashes.

flowchart TD
  A --> B

Next steps

Paste your own version into the Mermaid repair tool, which applies this correction and fourteen others and shows every change. The related page covers the surrounding syntax, and the error dictionary lists every message.