The short answer
Mermaid reads the first line to decide what to draw: flowchart TD, mindmap, sequenceDiagram, gantt and so on. When the first line is none of those keywords you get No diagram type detected matching given configuration for text. The editor shows this as "No diagram code found".
Cause 1: it is an outline, not code
Ask an AI assistant for a mind map and it sometimes returns an indented or numbered outline:
Project plan
Research
Design
Build and test
That is not Mermaid code yet. Add a mindmap line on top and indent the rest one more level:
mindmap
Project plan
Research
Design
Build and testEdit the text, switch themes and download PNG, Word or PowerPoint from there.
When the editor sees an indented, numbered or Markdown-heading outline it offers "Turn into a mind map" directly.
Cause 2: the first line is missing
Only the second half of the code was copied, or the assistant left the first line out:
A[Start] --> B{Approved?}
B -- Yes --> C[Done]
Add flowchart TD and it renders:
flowchart TD
A[Start] --> B{Approved?}
B -- Yes --> C[Done]Edit the text, switch themes and download PNG, Word or PowerPoint from there.
Cause 3: a typo or an alias on the first line
flowchartwritten asflowchatorflow chart;mindmapwritten asmind map.- A radar chart needs
radar-beta, notradar; a fishbone diagram needsishikawa-beta, notfishbone. - An invisible character before the first line, or
flowchart-TDwith a hyphen where a space belongs.
The editor recognizes these and shows a one-click "Fix it".
Cause 4: another diagram language
digraph G { … } is Graphviz DOT and @startuml … @enduml is PlantUML. Neither is interchangeable with Mermaid. Send the code to an AI assistant, ask it to rewrite it as Mermaid, and paste the whole reply back.
You only have a description
If what you pasted is a paragraph, a web page or a description of a picture, it really is not code. Click "Draw it with AI" in the editor and the text becomes a diagram, or follow Only text, no code to ask an assistant yourself. Other errors are covered in Common errors.