gitGraph throws error in wrong format for live editor.
See original GitHub issueDescribe the bug
Cannot change the main branch to anything.
To Reproduce Go to https://mermaid.live and select Git Graph from the samples pane.
Change config to this:
{
"theme": "default",
"gitGraph": {
"mainBranchName": "trunk"
}
}
Go back to the diagram and try to change main
to trunk
. It blinks and won’t change anything. The console lights up with errors like this:
Uncaught Error: D.hash.loc is undefined
S@https://mermaid.live/_app/pages/edit.svelte-6f83f87b.js:109:13610
ln/</<@https://mermaid.live/_app/chunks/index-3ccfa173.js:4:906
ln/<@https://mermaid.live/_app/chunks/index-3ccfa173.js:4:892
In/</</<@https://mermaid.live/_app/pages/edit.svelte-6f83f87b.js:14:1891
Trying it the other way around - changing main
to trunk
in the editor first (before config), logs that a branch isn’t created yet, as expected, then changing main
in config to trunk
resets the editor back to main
.
Expected behavior
The editor shall allow users to change the name of the main branch to an arbitrary name.
Desktop (please complete the following information):
- OS: Windows 10
- Browser: FireFox, Chrome
- Version: both latest, as of this post
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top Results From Across the Web
gitGraph throws error in wrong format for live editor. #3191
Go to https://mermaid.live and select Git Graph from the samples pane. Change config to this: { "theme": "default", "gitGraph" ...
Read more >How can I fix git commit error "Waiting for your editor to close ...
The issue seems due to the gutentags plugin. So, if you arrived here because you are getting the Waiting for your editor to...
Read more >Mermaid support for class diagrams and state diagrams
Wiki editor supports only a limited set of mermaid's diagram types. I guess with a simple mermaid upgrade we could get both class...
Read more >Changelog - Mermaid zh-cn doc - Hello Wac
live editor latin error after update #560; Simple full example in online documentation is broken #558; Graph No Arrow Head v7.0.3 #543; Conflict ......
Read more >VS Code tips — The Git Graph extension - YouTube
Get visual and interactive view of the current .git repository with the Git Graph extension for VS Code.Browse through commits, switch ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue is now fixed. Verified in Mermaid Live Editor against mermaid v9.1.6
@ashishjain0512, I’m fixing the editor hanging issue in mermaid-js/mermaid-live-editor#864. But the issue happened because the Error thrown by the gitGraph is totally different from the Error thrown by other diagram types. It lacks the
e.hash.loc
data, so we can’t highlight where the error is in the code.My current fix handles the situation and shows the thrown error above the diagram, but we should standardize the errors thrown by all diagram types.