← Back to editor

Mermaid error

A sequence message needs a colon before its text

Reproduced on Mermaid 11.17.2 · Updated

A sequence message needs a colon before its text in Mermaid. The exact parser message, why it happens, and corrected source that renders.

What Mermaid says

Parse error on line 2:
...  Alice->>Bob Hello
----------------------^
Expecting 'TXT', got 'NEWLINE'

Why it happens

Every message is written as sender, arrow, recipient, colon, text. Without the colon the parser reaches the end of the line still expecting the message text.

The source that fails

sequenceDiagram
  Alice->>Bob Hello

How to fix it

Add the colon between the recipient and the message.

sequenceDiagram
  Alice->>Bob: Hello

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.