Open ajoseps opened 1 year ago
You can load the previous Version of Mermaid, by Entering this: https://unpkg.com/mermaid@9.4.0/dist/mermaid.min.js Works fine for me as a workaround.
Just noticed, you posted the fix already. Sorry!
As @ajoseps suspected, in this mermaid issue they say:
As discussed above, I can confirm this has broken packages that include Mermaid via unpkg: i.e. https://unpkg.com/mermaid/dist/mermaid.min.js
JS deliver is indeed serving a cached version instead of the 404.
Swapping to https://unpkg.com/mermaid@10/dist/mermaid.esm.min.mjs resolves the issue (or use https://unpkg.com/mermaid@9/dist/mermaid.min.js if you can't switch to ESM).
I tried setting https://unpkg.com/mermaid@10/dist/mermaid.esm.min.mjs
in VSCode but it doesn't work, so changed to https://unpkg.com/mermaid@9/dist/mermaid.min.js
(which I assume picks up the latest available version as @mark-win suggested.
On April 15th, 2023, I also encountered a similar issue. Mermaid was not properly exported as a PDF, and I discovered that the cause was a failure in CDN reference.
When I visited UNPKG in browser mode, I found that the mermaid.min.js that should have been referenced as default setting was missing from https://unpkg.com/browse/mermaid@10.1.0/dist/. I reverted the version to mermaid@10.0.3-alpha.1 and applied the mermaid.min.js located there.
However, since "/browse/" did not provide the appropriate directory specification, I had to replace it with the following URL: "https://unpkg.com/mermaid@10.0.3-alpha.1/dist/mermaid.min.js"
Finally, Markdown PDF can now successfully convert Mermaid diagrams to PDF.
I was plagued by various minor issues such as
– where to change the settings,
– which recent version is working properly, and
– how to properly retrieve specific files (without being confused by URLs such as included "/browse/" when I accessed that place by browsing mode)
...but I managed to solve them on my own somehow.
Since I don't have the ability to contribute to the development of this useful program, I hope that the developers can modify it to reference the working js file as the default when this program is installed. Alternatively, I would appreciate it if the "Issue" section at the bottom of the program description could explicitly mention that this issue exists.
On April 15th, 2023, I also encountered a similar issue. Mermaid was not properly exported as a PDF, and I discovered that the cause was a failure in CDN reference.
When I visited UNPKG in browser mode, I found that the mermaid.min.js that should have been referenced as default setting was missing from https://unpkg.com/browse/mermaid@10.1.0/dist/. I reverted the version to mermaid@10.0.3-alpha.1 and applied the mermaid.min.js located there.
However, since "/browse/" did not provide the appropriate directory specification, I had to replace it with the following URL:
"https://unpkg.com/mermaid@10.0.3-alpha.1/dist/mermaid.min.js"
Finally, Markdown PDF can now successfully convert Mermaid diagrams to PDF.
I was plagued by various minor issues such as
...but I managed to solve them on my own somehow.
Since I don't have the ability to contribute to the development of this useful program, I hope that the developers can modify it to reference the working js file as the default when this program is installed. Alternatively, I would appreciate it if the "Issue" section at the bottom of the program description could explicitly mention that this issue exists.
I encountered the same issue today as @falettinsouls mentioned, and the following URL worked as expected (thank you very much!).
https://unpkg.com/mermaid@10.0.3-alpha.1/dist/mermaid.min.js
As far as I know, the latest stable release of Mermaid is 10.9.0. I also tried the following URL well. However, I couldn't generate a diagram with 10.9.0 (a PDF file was generated, but not with a diagram but with a source Markdown code as text).
https://unpkg.com/mermaid@10.9.0/dist/mermaid.min.js
I just wanted to update this discussion.
Just to add to this thread, I found this issue too when my erDiagram
wouldn't render. I found 10.4.0 worked fine:
https://unpkg.com/mermaid@10.4.0/dist/mermaid.js
Supported diagrams will correctly render (still not erDiagram
) but as implied by #365 and https://github.com/yzane/vscode-markdown-pdf/issues/342#issuecomment-1879182920 everything at 10.5.0 and after spits out the text instead.
The default value for the mermaid server is
https://unpkg.com/mermaid/dist/mermaid.min.js
. This URL resolves tohttps://unpkg.com/mermaid@10.0.0/dist/mermaid.min.js
and does not exist. There is ahttps://unpkg.com/mermaid@9.0.0/dist/mermaid.min.js
that exists (and works), but it seems like going forward mermaid is using a different format.The following files exist for
10.0.0
: mermaid.core.mjs mermaid.core.mjs.map mermaid.d.ts mermaid.esm.min.mjs mermaid.esm.min.mjs.map mermaid.esm.mjs mermaid.esm.mjs.map mermaid.spec.d.tsI tried replacing the URL with the
mermaid.esm.min.mjs
but that did not work. I'm not a web developer so I'm not sure if it is as simple as replacing the URL with one that points to one of these files.