Advertisement
❮ Previous: Plugins and Integrations Next: Mermaid Performance ❯

Mermaid Troubleshooting

Unclosed Syntax

Unclosed quotes or brackets can cause parsing errors.

Incorrect:

A["Unclosed label]

Correct:

flowchart LR
    A["Closed label"] --> B

Reserved Words

Avoid lowercase end as a node label when it can be interpreted as a control keyword.

Prefer:

flowchart LR
    A[Start] --> B[End]

Mermaid Code Fence

Make sure the Markdown fence is labeled mermaid.

Correct:

```mermaid
flowchart LR
    A --> B
```

Diagram Not Rendering

Check:

  1. The code block is labeled mermaid.
  2. The host platform supports Mermaid.
  3. Mermaid is loaded when using HTML.
  4. The diagram syntax is valid.
  5. The correct Mermaid version is being used for the syntax.

Subgraph Problems

If a subgraph is collapsed or contains complex connections, verify the supported view: collapsed syntax and the relationships crossing the subgraph boundary.


Export Problems

Some environments may not render Mermaid correctly when exporting to PDF.

A practical approach is to pre-render the diagram using Mermaid CLI:

mmdc -i diagram.mmd -o diagram.svg
❮ Previous: Plugins and Integrations Next: Mermaid Performance ❯
Advertisement