← Back to editor

Mermaid error

An arrow with nothing after it

Reproduced on Mermaid 11.17.2 · Updated

An arrow with nothing after it in Mermaid. The exact parser message, why it happens, and corrected source that renders.

What Mermaid says

Parse error on line 4:
...D  A --> B  B -->
--------------------^
Expecting 'AMP', 'COLON', 'PIPE', 'TESTSTR', 'DOWN', 'DEFAULT', 'NUM', 'COMMA', 'NODE_STRING', 'BRKT', 'MINUS', 'MULT', 'UNICODE_TEXT', got 'EOF'

Why it happens

Every link needs a node on the right. A line that ends with an arrow leaves the statement unfinished, and the error points at the end of the line.

The source that fails

flowchart TD
  A --> B
  B -->

How to fix it

Complete the link, or delete the trailing arrow.

flowchart TD
  A --> B
  B --> C

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.