fralau / mkdocs-mermaid2-plugin

A Mermaid graphs plugin for mkdocs
https://mkdocs-mermaid2.readthedocs.io
MIT License
203 stars 25 forks source link

Cannot get theme to work on 10.2.4 #78

Closed THENATHE closed 12 months ago

THENATHE commented 12 months ago

When running 10.2.4 of mermaid, using the most recent mkdocs version and most recent mermaid2 version, I cannot get the theme to apply, and receive the following error in the console (unsure if it is related)

(index):217 Uncaught ReferenceError: mermaid is not defined
    at (index):217:9
(anonymous) @ (index):217

https://i.imgur.com/2JG38u0.png

Additionally, unrelated but I also cannot get images inside chart boxes to work in 9.4.0

fralau commented 12 months ago

The one thing I can think of, is that the link called by the import clause does not exist (does that version exist? is it already on that package manager -- latency problem?) I would try to see that link in the browser.

Issues with how Mermaid versions are working are connected with the javascript library. It is best to consult their changelog on github and their issues (or to open one).

THENATHE commented 12 months ago

is it already on that package manager -- latency problem?) I would try to see that link in the browser.

This gave me a really good idea. I looked at the link that it was calling, and it was minified but the plugin (presumably) didnt understand that. Simply calling the actual js file instead of using the version declaration in the plugin solved the issue!

I added this to my config

extra_javascript:
  - "https://unpkg.com/mermaid@10.2.4/dist/mermaid.min.js"

Thanks!

fralau commented 12 months ago

That looks like a hack, but the good news is that it worked!