detectType
keep throw Error
#6462
-
I tried to check if a string is a mermaid chart using import mermaid from 'mermaid';
const diagram = `graph LR
a-->b
b-->c
c-->d
d-->e
e-->f
f-->g
g-->h`;
try {
const type = mermaid.detectType(diagram); // this keep throw error
console.log('type:', type);
} catch (error) {
console.error('detectType:', error);
} |
Beta Was this translation helpful? Give feedback.
Answered by
A9G-Data-Droid
Apr 28, 2025
Replies: 1 comment
-
You have to call initialize first.
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ZiuChen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You have to call initialize first.
mermaid.initialize()