When a diagram does not draw
The macro never leaves an empty box. When it cannot draw, it says why in plain words.
A mistake in the diagram text
The panel's title is "The diagram has a syntax error". Below it:
- Line N: and a sentence saying what is wrong.
- The diagram text with line numbers, and the line with the mistake marked.
- Details, closed at first: Mermaid's own message, for when the sentence is not enough.
The sentences you may see:
| The panel says | What to do |
|---|---|
| The first line does not name a diagram type Mermaid knows. | Start with a type such as flowchart TD, sequenceDiagram or classDiagram. |
| A bracket here is never closed. | Each [ needs a ], each ( a ) and each { a }. |
| In a flowchart, "end" cannot be a node name on its own. | Write End or "end" instead. |
| Mermaid does not know this arrow. | In a flowchart, write --> for an arrow or --- for a line. |
A shape such as (Stop) or [Stop] needs a node name in front of it. |
Write B(Stop). |
| This line ends before it is complete. | Something is missing at the end, such as the node after an arrow. |
| Mermaid does not expect the character "x" here. | Remove or quote the character. |
| Mermaid expects "x" here, but finds "y". | Write what Mermaid expects. |
| Mermaid cannot read the diagram here. | Open Details to see what Mermaid expected. |
The specific sentences are written for flowcharts. Other diagram types get the general ones, and Details says more.
Two refusals look like syntax errors, because the macro loads nothing from outside Confluence:
- "This macro loads nothing from outside Confluence, so a shape cannot show an image from a web address (img:). Remove img from this line."
- "This macro loads nothing from outside Confluence, so a style cannot point at a file or web address (url(), image-set() or @import). Remove it from this line; if it is part of a label, put the label in double quotes."
See Limits.
No diagram text
| The panel says | Why, and what to do |
|---|---|
| No diagram text yet. To add one, edit the page, click this macro and choose Edit (the pencil), or put a Mermaid code block next to it. | The macro is empty and the page has no code block it can use. See Draw a code block that is already on the page. |
| No diagram text yet. The code block in this macro is marked as language. | Set the code block's language to Mermaid, or leave it unset. |
| No diagram text yet. The Mermaid code block next to this macro is empty. | Add the diagram to that code block. |
| No Mermaid code block on this page. | The page's code blocks do not start with a Mermaid diagram type. Start one with it, or type the diagram into this macro. |
| The diagram cannot find its place on the page. | Save the page and reload it. This can happen just after the macro is inserted. |
Too large
"The diagram is too large to draw" says which limit it passed, with the numbers, and asks you to split the diagram into smaller ones, each in a macro of its own. The limits are in Limits.
Too slow
"The diagram is taking too long to draw" shows when a diagram has not finished after 30 seconds, for instance on a very slow connection. Reload the page to try again. If the diagram arrives after all, it replaces the panel. A PDF export shows the panel in place of that one diagram, so the export still finishes.
Something else
"The diagram could not be drawn" or "The diagram text cannot be read", with a reason. Reload the page once. If it stays, tell us and include the reason the panel gives.
Diagrams while editing
While the page is being edited, Confluence shows the macro's text, not the drawing. That is normal: the drawing appears when you publish. To see it while you write, use Edit (the pencil) to open the window.