diff --git a/packages/mermaid/src/dagre-wrapper/shapes/util.js b/packages/mermaid/src/dagre-wrapper/shapes/util.js index f67af5b29..3eaedb4b9 100644 --- a/packages/mermaid/src/dagre-wrapper/shapes/util.js +++ b/packages/mermaid/src/dagre-wrapper/shapes/util.js @@ -86,9 +86,11 @@ export const labelHelper = async (parent, node, _classes, isNode) => { } res(img); } - if (img.complete) { - setupImage(); - } + setTimeout(() => { + if (img.complete) { + setupImage(); + } + }); img.addEventListener('error', setupImage); img.addEventListener('load', setupImage); })