Mermaid error
The first line must declare the diagram type
Reproduced on Mermaid 11.17.2 · Updated
The first line must declare the diagram type in Mermaid. The exact parser message, why it happens, and corrected source that renders.
What Mermaid says
No diagram type detected matching given configuration for text: Request --> Approve
Approve --> DeployWhy it happens
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.
The source that fails
Request --> Approve
Approve --> DeployHow to fix it
Put the diagram keyword, and for a flowchart its direction, on the first line.
flowchart TD
Request --> Approve
Approve --> DeployNext steps
Paste your own version into the Mermaid repair tool, which applies this correction and fourteen others and shows every change. The related page covers the surrounding syntax, and the error dictionary lists every message.