Parentheses inside a node label break a flowchart
Round brackets are shape syntax in a flowchart. Inside an unquoted label, the first bracket is read as the start of a different node shape and the statement falls apart.
Reproduced, not remembered
Every Mermaid error message reproduced on version 11.17.2, with the cause, the source that fails, and corrected source that renders.
Each page quotes the message this build actually produced, explains what the parser was doing when it gave up, and shows source that renders. To repair a whole block at once, use the Mermaid repair tool.
Round brackets are shape syntax in a flowchart. Inside an unquoted label, the first bracket is read as the start of a different node shape and the statement falls apart.
The first closing square bracket ends the node definition, so the characters after it are read as a new statement on the same line.
The vertical bar introduces an edge label. Inside an unquoted node label it ends the label and the parser expects an edge instead.
A label that opens a round bracket without closing it leaves the parser waiting for the matching character, and the line ends first.
The second double quote closes the label. Whatever follows is read as syntax rather than text.
A word processor or chat client replaced straight quotes with typographic ones. Mermaid only recognises the straight double quote, so the label is still unquoted and any bracket inside it breaks the line.
A bare lowercase end is the token that closes a subgraph. Used as a node identifier it closes a block that was never opened.
Words such as graph, class and style begin statements. Used as an identifier they start the statement they name, and the rest of the line becomes unexpected input.
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.
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 two vertical bars open and close an edge label, so Mermaid expects text between them and finds the closing bar instead.
A subgraph block stays open until an end line closes it. Without that line the later statements are read inside the group and the diagram fails at the last line.
The subgraph keyword expects an identifier or a title after it. With nothing there, the renderer has no label to read and fails before it draws anything.
Two answers were pasted together, so a second flowchart or graph line appears in the middle. The parser reads it as part of the previous statement.
Mermaid chooses a parser from the first token. With only arrows in the block there is no diagram type to parse against, so nothing matches.
A sentence from a chat answer sits above the code. The first line is no longer a diagram type, so no parser matches the block.
The three backticks and the word mermaid belong to Markdown, not to the diagram. As the first line they stop any diagram type from being detected.
Mermaid mindmaps use indentation, not Markdown bullets, and the block still needs the mindmap keyword. A bulleted outline matches no diagram type at all.
Indentation is the only thing that says which topic owns which. A child at the same depth as the root becomes a second root, which a mindmap cannot have.
The relationship statement expects a colon and a name after the two entities. Without it the line ends where a colon was expected.
The inheritance marker must be followed by two dashes for a solid line or two dots for a dotted one. A single dash is not a line token.
State transitions use the same two-dash arrow as flowcharts. A single dash is not recognised.
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.
Each slice is a quoted label, a colon and a number. A word in the value position is rejected by the lexer before the chart is built.
A merge can only target a branch that exists at that point in the graph. Naming one that was never created stops the diagram with a message about the merge.