← Back to editor

Mermaid error

An edge label with no text

Reproduced on Mermaid 11.17.2 · Updated

An edge label with no text in Mermaid. The exact parser message, why it happens, and corrected source that renders.

What Mermaid says

Parse error on line 2:
...lowchart TD  A -->|| B
----------------------^
Expecting 'TAGEND', 'STR', 'MD_STR', 'UNICODE_TEXT', 'TEXT', 'TAGSTART', got 'PIPE'

Why it happens

The two vertical bars open and close an edge label, so Mermaid expects text between them and finds the closing bar instead.

The source that fails

flowchart TD
  A -->|| B

How to fix it

Put text between the bars, or remove them.

flowchart TD
  A -->|yes| 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.