-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Invalid value for <svg> attribute viewBox="0 0 -Infinity -Infinity" #291
Comments
I am getting the same error when calling mermaid.init(); |
Ok, sorry about that. What version of mermaid are you running on? |
Actually, I think I figure it out, this error happens when you try to use mermaid.init() in a div with class "mermaid" and this div is empty, without the graph definition. I tested it in all versions above 4.0, including 4.0 and they all have this problem, although the version in the 'editor' folder, which I believe is an much older one, works fine. |
Ok. As of 4.0 the initialization code changed a bit. Perhaps this should be reported in the the jekyll repository. |
any solution for this? |
I too am looking for a solution to this. I'm using version 6.0.0, which I think is the latest release. I'll try the latest in master to see if it's been fixed, but in the meantime, I've been working around it by executing the following code after initialization:
This is where main is the div containing the svg. Posting this here in case it happens to help someone. |
I am also having a problem with version 7 |
Also having this problem with a code sample pulled from the docs page |
The problem is with calling init. If you dont call it like this...
then the |
Thank you, @StingyJack! Simply adding the following fixed this issue:
I would say this Issue could be closed, since documentation also recommends this: http://knsv.github.io/mermaid/#sample-of-api-usage-together-with-browserify |
This also occurs if the input text can't be parsed, and you only get useful feedback if you've switched logging to the lowest level. I think parsing errors should be displayed within the container element. |
Still see this problem on /cc @tylerlong |
This worked for me: mermaid.initialize({
mermaid: {
startOnLoad: false
}
}); Notice the addition of the I ran https://github.com/mermaidjs/mermaid-live-editor in the debugger and confirmed that leaving this out doesn't do the right thing. |
As mentioned in mermaid-js/mermaid#291 (comment), the parameter should be `startOnLoad` instead of `loadOnStart`. In addition, `mermaid.initialize()` expects to see `startOnLoad` in the `mermaid` hash: https://github.com/knsv/mermaid/blob/6cd5ffe637d88525b93417bf3954e9c0e5a4deb8/src/mermaid.js#L118 Closes #42052
For those who are still suffering from this, could you please give me a sample so that I can reproduce this issue? You can either create it here: https://mermaidjs.github.io/mermaid-live-editor Or you can create a simple HTML page and post it here. |
@tylerlong - I can point you to this or this, but I'm not sure how useful (or horrifying) those are going to be to you. |
There is no problem for me to render the chart in the orignal question: https://mermaidjs.github.io/mermaid-live-editor/#/edit/Z3JhcGggVEQ7CiAgICBBLS0-QjsKICAgIEEtLT5DOwogICAgQi0tPkQ7CiAgICBDLS0-RDs If anybody could prove that it is a mermaid bug, please open a new issue. I think
should be mermaid.initialize({
startOnLoad: false
}); Please test the latest version and let me know if it doesn't work for you. |
Using the Jekyll plugin and getting the above error. Also get the error when calling
mermaid.init();
The svg looks like:
for the example:
The text was updated successfully, but these errors were encountered: