# Why your Mermaid diagram won’t render — and how to tell

December 3, 2026 · By isaced

Your Mermaid diagram can fail to appear even when its code is valid. Check the code block, first line, copied text, and drawing tool before rewriting it.

## Check these four things in 60 seconds

Check these four things first: most missing diagrams start with the code block, first line, copied text, or drawing tool.

Mermaid turns text into diagrams. You write boxes and arrows as lines of code; a renderer is the tool that draws them. You do not need to learn the whole language to run these checks.

1. **Mark the block as Mermaid.** In Markdown, start with three backticks with mermaid written after them. Close with three backticks on a separate line. This tells a Mermaid-enabled preview to draw the contents, rather than display the code.

2. **Put the diagram type first.** Start the contents with flowchart TD for a top-to-bottom flowchart, or sequenceDiagram for a conversation between participants. Keep your title outside the example while testing. A sentence describing a diagram cannot replace this first line.

3. **Clean up copied text.** Replace any unfinished placeholders from AI output with real labels. Retype suspicious quotes and arrows to remove curly quotes or invisible characters. Keep an untouched copy so you can compare your changes.

4. **Try another drawing tool.** Paste the same diagram into a second renderer you already use. With Mernyx installed, you can also select its .mmd file in Finder and press Space for Quick Look. Use only the diagram text in that file, without the backtick lines.

Compare these two Markdown blocks. The first normally shows text instead of a diagram because its opening line leaves out mermaid. The second asks a Mermaid-enabled preview to draw two boxes joined by an arrow.

Wrong: no Mermaid label

````text
```
flowchart TD
    A[Start] --> B[Finish]
```
````

Right: add mermaid after the backticks

````text
```mermaid
flowchart TD
    A[Start] --> B[Finish]
```
````

If the second tool draws your diagram, check the original editor’s Mermaid support and version. If both fail, keep investigating: they may share the same limitation. Two failures alone do not prove your code is wrong.

![A coral path passes a code block, a first line, hidden characters, and a second viewer, then splits into drawn and blank results.](/blog/why-your-diagram-wont-render/no-header.webp)

Four checkpoints lead to two possible results.

## Tell five causes of a blank canvas apart

Match the failure to one of five causes before changing your code.

- **No recognised first line.** The tool cannot tell which kind of diagram to draw. You may see “Unrecognized diagram” or a request for a diagram type. Check the first line inside your code block.

- **A syntax error.** A bracket, arrow, quote, or other piece of code breaks Mermaid’s rules. You may see “Parse error” and a line number. Check that line and the line before it for an unfinished expression.

- **An unsupported diagram type.** The tool recognises the kind you requested but cannot draw it. You may see an unsupported-type notice, or just a blank preview. Check which diagram types your tool supports.

- **A diagram that is too large.** The renderer gives up when there are too many nodes to place or connections to arrange. You may see a size warning or the previous picture. Try fewer boxes and arrows.

- **Drawing stopped.** The tool started arranging the diagram but stopped for another reason. You may see a failure notice without a useful source line. Save a small example that still fails and report it.

A flowchart with 175 boxes and 56 crossing arrows was reported as “Unrecognized diagram”. The source was valid — the renderer had hit its limit for arranging them.

For a source error in Mernyx, try Fix with AI (⌥⌘F) and review the proposed line-by-line change. Apply appears only when the error count falls.

Do not treat these messages as universal wording. GitHub can show “Unable to render rich display” for several problems. Read any detailed error, then test the cause rather than guessing from that banner.

![A code card branches into five result cards: an empty frame, a broken line, an unsupported shape, a tangle, and a blank card.](/blog/why-your-diagram-wont-render/failures.webp)

Five different results from one code card.

## Fix a valid diagram that still will not draw

Simplify a crowded diagram, or update a renderer that cannot read newer Mermaid syntax.

First, test a smaller copy without changing the original. Remove repeated connections, replace a busy group with one box, or split the diagram into two. Putting boxes inside a group called a subgraph does not reduce the work needed to arrange them.

Add the removed parts back gradually. If a small version draws and the full one fails, complexity may be the problem. There is no single node limit that applies to every diagram and renderer.

Next, check whether your example uses syntax newer than your renderer. Mermaid.js added the shape notation below in version 11.3.0. An older version can reject it even though the code is valid.

Fails before Mermaid.js 11.3.0: newer shape syntax

```mermaid
flowchart TD
    A@{ shape: rect, label: "Start" }
```

Works in older versions: the same rectangle

```mermaid
flowchart TD
    A[Start]
```

Both examples ask for one rectangle labelled Start. Update the preview tool, or use the older notation when you cannot update it. Check the renderer’s version, not just your editor’s version: plugins can bundle an older copy.

Watch for an unchanged picture after an edit. Some tools keep the last successful drawing when the new version fails. Read the warning before assuming the visible picture matches your current code.

![An arrow connects a tangled diagram to five simple boxes; a smaller panel keeps the previous drawing beneath a warning.](/blog/why-your-diagram-wont-render/too-large.webp)

A tangled diagram becomes five connected boxes.

## Check three problems outside the diagram itself

Check indentation, settings, and colours when the diagram’s own lines look correct.

- **Indentation around a code block.** Inside a Markdown list, align the backtick lines with the item’s content. Otherwise, the page may show code or break the list instead of drawing. Test by moving the whole block outside the list, with both backtick lines at the left margin.

- **Broken settings above the diagram.** A line wrapped in %%{…}%% tells some renderers which settings to use. A missing quote or brace there can stop the whole drawing. Test by removing that settings line from a copy and drawing again.

- **Colours that hide the picture.** Boxes, labels, and arrows can match the background colour. The tool then draws a diagram you cannot see. Test with the default theme and no custom styles, including styles added by the page.

![Three panels show an indented code block, a cracked settings brace, and a diagram almost invisible against its background.](/blog/why-your-diagram-wont-render/hidden.webp)

Indented text, broken braces, and barely visible boxes.

## Why a named cause saves time

Read Mernyx’s error bar to see all reported problems and find out what needs fixing.

Click any error with a line number to jump to that line in your code.

When a diagram grows too large, Mernyx keeps the previous picture and explains why the new version did not draw.

![An editor keeps a five-box flowchart below a warning bar; one error row connects to a highlighted box.](/blog/why-your-diagram-wont-render/product.webp)

A highlighted error beside the previous drawing.

[Check what Mernyx can draw and edit](/capabilities/index.md)

[All posts](/blog/index.md)
