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 doesn't work caused of deprecated mermaid.render method #1793

Closed
mirusu400 opened this issue Aug 2, 2023 · 0 comments
Closed

Mermaid doesn't work caused of deprecated mermaid.render method #1793

mirusu400 opened this issue Aug 2, 2023 · 0 comments

Comments

@mirusu400
Copy link
Contributor

mirusu400 commented Aug 2, 2023

With the release of Mermaid v10 on February 21, 2023, a change has been made to the mermaid.render function where it no longer accepts callbacks and only supports async operations. changelog

Due to this change, an issue has arisen where JavaScript in the HTML document created via the uftrace dump --mermaid command fails to function as expected. The error message provided is shown below:

mermaid.min.js:6 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'createElementNS')
    at Function.<anonymous> (mermaid.min.js:6:16723)
    ...
    at mermaid.min.js:87:669
    at new Promise (<anonymous>)
    at Object.UOt [as render] (mermaid.min.js:87:479)
    at renderGraph (a.html:270:10)
    at drawBaseGraph (a.html:246:2)
    at HTMLButtonElement.onclick (a.html:40:61)

Honeycam 2023-08-03 02-54-13

We can solve the problem by simply modifying the source code to use v9, but it seems necessary to rewrite the entire source code to ESM for maintenance.

mirusu400 added a commit to mirusu400/uftrace that referenced this issue Aug 2, 2023
After Mermaid v10, the function 'mermaid.render'
does not support callback, but only supports async operation.

This commit fixed the Mermaid to work by temporarily
specifying the version of Mermaid as v9.

Ref: namhyung#1793

Signed-off-by: Seong Jin Kim <mirusu400@naver.com>
mirusu400 added a commit to mirusu400/uftrace that referenced this issue Aug 5, 2023
After Mermaid v10, the function 'mermaid.render'
does not support callback, but only supports async operation.

Due to this change, an issue has arisen where JavaScript in
the HTML document created via the 'uftrace dump --mermaid'
command fails to function as expected.

This commit fixed the Mermaid to work by temporarily
specifying the version of Mermaid as v9.

Fixed: namhyung#1793

Signed-off-by: Seong Jin Kim <mirusu400@naver.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant