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

Breaking change between 9.1.3 and 9.1.4 with Docusaurus #3428

Closed
EugeneLeclerc opened this issue Sep 7, 2022 · 6 comments
Closed

Breaking change between 9.1.3 and 9.1.4 with Docusaurus #3428

EugeneLeclerc opened this issue Sep 7, 2022 · 6 comments
Assignees
Labels
Type: Bug / Error Something isn't working or is incorrect
Milestone

Comments

@EugeneLeclerc
Copy link

Hi! I would like to first thank you for Mermaid, I use it a lot and I've been happy with it for a long time.

Describe the bug

I'm using Mermaid with docusaurus (2.1.0) and mdx-mermaid (1.3.2), both latest versions. Between mermaid-js 9.1.3 and 9.1.4, something changed in mermaid-js that broke my Git Graphs. The generated SVG is simply empty, with no error displayed anywhere. I'm conscious the problem may be somewhere in mdx-mermaid, but I did not expect a simple minor version change to change behaviour.

To Reproduce
Steps to reproduce the behavior:

  1. Create a simple Docusaurus project and use mdx-mermaid with it.
  2. Write a simple Git Graph in one of your Docusaurus page like the one from your doc
    image
  3. On 9.1.3, the graph works well:
    image
  4. On 9.1.4, it does not:
    image
    On 9.1.4, the generated SVG is empty:
    image

Expected behavior
I expect the Git Graph to show properly. If there is a problem, I would expect an error showing somewhere. Even if the problem is with mdx-mermaid or docusaurus, I would not expect a patch version change in mermaid-js to break anything.

Platform:
Probably not relevant, but:

  • OS: Windows
  • Browser: Both Chrome 104 and Firefox 104

Once again, thanks for your work on Mermaid! I do not have time right now to investigate further, but I will try to find the problematic commit later.

@EugeneLeclerc EugeneLeclerc added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Sep 7, 2022
@aloisklink
Copy link
Member

Does this also affect the latest version of mermaid, v9.1.5 or v9.1.6?

I also had issues upgrading from v9.1.3 to v9.1.4, however this was fixed in v9.1.5.

I'm the creator of remark-mermaid-dataurl, which is a similar plugin for adding mermaid to docusaurus (although for docusaurus, mdx-mermaid is usually better than my plugin, since mdx-mermaid does client-side rendering).

@EugeneLeclerc
Copy link
Author

Yes, this behavior is also present in 9.1.5 and 9.1.6. I initially found it by upgrading from 9.1.1 to 9.1.6 and worked backward through the version history to find the breaking point (9.1.3 -> 9.1.4).

@knsv knsv removed the Status: Triage Needs to be verified, categorized, etc label Sep 8, 2022
@knsv
Copy link
Collaborator

knsv commented Sep 8, 2022

OK. First of all we need to reproduce this issue. Any hints on how to go about that would be appreciated. 😄

We then fix the issue in the 9.1.7 release branch,

@EugeneLeclerc
Copy link
Author

I will try to create you a sample project with the bug when I get the time in the next few days. Thanks for the answer!

@knsv
Copy link
Collaborator

knsv commented Sep 9, 2022

@EugeneLeclerc I managed to reproduce the issue. It has to do with work decoupling the diagrams from the core of Mermaid and with how mdx-mermaid use Mermaid. The decoupled diagrams are loaded when initialize is called. In the plugin I believe that initialize is only called when config is supplied.

I could make a gitgraph appear when suppling a theme for instance. When I did not supply the config, initialise was never called. I have updated Mermaid so that the loosely coupled diagrams are called even without the initialize call. This fix will be released in 9.1.7

knsv added a commit that referenced this issue Sep 9, 2022
@EugeneLeclerc
Copy link
Author

Thanks a lot!

@sidharthv96 sidharthv96 added this to the 9.1.7 milestone Sep 13, 2022
sidharthv96 added a commit that referenced this issue Sep 14, 2022
…lease

* origin/release/9.1.7:
  Release 9.1.7
  Fix for broken rendering test
  Fix for issue #3428, load the configured diagrams even when initialize has not been called.
sidharthv96 added a commit that referenced this issue Sep 14, 2022
* sidv/mergeRelease:
  chore(deps-dev): bump eslint-plugin-jest from 27.0.1 to 27.0.4 (#3458)
  chore(deps-dev): bump @typescript-eslint/eslint-plugin (#3457)
  chore(deps-dev): bump concurrently from 7.3.0 to 7.4.0 (#3445)
  chore(deps-dev): bump @babel/preset-env from 7.18.10 to 7.19.0 (#3442)
  chore(deps-dev): bump @typescript-eslint/parser from 5.36.1 to 5.37.0 (#3451)
  chore(deps-dev): bump @babel/core from 7.18.13 to 7.19.0 (#3447)
  chore(deps-dev): bump jest-environment-jsdom from 29.0.2 to 29.0.3 (#3441)
  chore(deps-dev): bump babel-jest from 29.0.2 to 29.0.3 (#3448)
  chore(deps-dev): bump eslint from 8.23.0 to 8.23.1
  Release 9.1.7
  Fix for broken rendering test
  Fix for issue #3428, load the configured diagrams even when initialize has not been called.
sidharthv96 added a commit that referenced this issue Sep 16, 2022
* develop:
  Replace GoogleAnalytics with Plausible
  fix(git): support single character branch names
  Cleanup unused variables and some commented out code
  Release 9.1.7
  Fix for broken rendering test
  Fix for issue #3428, load the configured diagrams even when initialize has not been called.
  #3395 Renabling the error graph which is rendered on error
  #3395 Fix for lopp stopping at first failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

4 participants