Diagramate

Common errors and how to fix them

Updated 2026-09-02

When the pasted code has a syntax problem, the bar under the editor explains it in plain language with a line number. Click “Go to line N” to jump there; the preview keeps the last good render until it is fixed. The bar also offers “AI fix”, which shows a diff and checks the result locally before you apply it. The sections below follow the messages you may see.

Edges are written as -->; -> is not a Mermaid arrow

Flowchart edges use two dashes: A --> B. The single-dash -> only appears in sequence diagrams (A->>B). Replace -> with --> on that line.

end is a reserved word

end closes subgraph, loop and similar blocks, so it cannot be a node name. Use End or END, or give it a label: e1[end].

Unclosed bracket

[ needs ], ( needs ), { needs }. The usual cause is brackets inside the node text, for example A[Login (phone)]. Wrap the text in double quotes: A["Login (phone)"].

This line contains a full-width character

Mermaid only accepts half-width (ASCII) punctuation in syntax positions. Replace ():,; with () : , ;. Punctuation inside node text is fine; only the characters that act as syntax matter. The bar tells you which character it found.

No diagram type found

The first line has to be a diagram keyword: flowchart TD, graph LR, sequenceDiagram, classDiagram, stateDiagram-v2, gantt, pie, mindmap and so on. Assistants sometimes mention the keyword in the prose instead of the code. Add it as the first line.

A subgraph or block is missing its closing end

Every subgraph, loop, alt, opt and par needs an end line. The line number points at the end of the code because the parser reached the end without finding it.

Incomplete message line

Sequence diagram messages need all their parts: A->>B: message text. The arrow has to be followed by a participant, and the text comes after the colon.

Incomplete relationship symbol

ER diagram relationships need a cardinality on both ends, for example USER ||--o{ ORDER : has. Leaving out one side of ||, o{ or }| triggers this message.

A mind map can have only one root node

Mind maps are structured by indentation: mindmap on the first line, a single root such as root((Topic)) on the second, and every level below indented two more spaces. A second top-level node, or a root indented deeper than its branches, triggers this message; the bar names the node. A stray end line is treated as a second root as well.

Diagram too large: more than 500 edges

This is not a syntax error but a safety limit of the renderer. Split the diagram by module or trim the branches. A diagram this size does not fit on one page in any tool.

Syntax error on this line

The fallback message when none of the above applies. It quotes the text near the problem. Common causes: unpaired arrows, brackets or quotes; special characters such as | or " inside node text (wrap the text in double quotes); pie chart rows that are not written as "label" : value.

This line contains a character Mermaid can't read

Usually a special or invisible character that came along when copying from a web page. Delete the line and retype it.

The diagram code has a syntax error

The fallback when no line number is available. Check arrows, brackets and indentation, or click “AI fix”.

Open the editor

Related articles