Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mermaid.init is broken #3025

Closed
zephyraft opened this issue May 11, 2022 · 0 comments
Closed

mermaid.init is broken #3025

zephyraft opened this issue May 11, 2022 · 0 comments
Labels
Status: Approved Is ready to be worked on Type: Bug / Error Something isn't working or is incorrect

Comments

@zephyraft
Copy link
Contributor

Describe the bug
Version 9.1.0 mermaid.init call is broken. It works fine when using the previous version(9.0.1).

To Reproduce
This can be easily reproduced using the code snippet below.

Expected behavior
graph can be rendered

Code Sample

<html lang="en-US">
<head>
    <title>init call</title>
<!-- 9.0.1 works fine -->
<!--    <script src="https://cdn.jsdelivr.net/npm/mermaid@9.0.1/dist/mermaid.min.js"></script>-->
    <script src="https://cdn.jsdelivr.net/npm/mermaid@9.1.0/dist/mermaid.js"></script>
</head>
<body>
    <code class="test">
        graph LR
        A --- B
    </code>
    <script>
        mermaid.init(undefined, ".test");
    </script>
</body>
</html>

Additional context
After looking at the source code, I think #2379 caused this bug.
init called initThrowsErrors but not pass arguments, so arguments.length of initThrowsErrors is always 0.

@zephyraft zephyraft added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels May 11, 2022
@knsv knsv added Status: Approved Is ready to be worked on and removed Status: Triage Needs to be verified, categorized, etc labels May 11, 2022
ashishjain0512 added a commit that referenced this issue May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Approved Is ready to be worked on Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

2 participants