Giter Club home page Giter Club logo

Comments (11)

BeWe11 avatar BeWe11 commented on August 21, 2024 3

Hey all,

I don't think the main problem here is that mermaid CLI hangs on syntax errors, but rather that mermaid-filter uses an outdated mermaid version that produces these syntax errors.

The package.json file of mermaid-filter defines a mermaid version of ^7.1.2, while the newest mermaid version is 8.4.8.

After cloning mermaid-filter and manually bumping the major version of mermaid, I am able to render my mermaid graphs without hanging.

Is there a reason why mermaid-filter doesn't use mermaid 8.x.x?

from mermaid-filter.

raghur avatar raghur commented on August 21, 2024 1

Thanks folks... just updated package.json and published to npm

from mermaid-filter.

lopezator avatar lopezator commented on August 21, 2024

@raghur I still can reproduce the issue using v1.4.2. Can you confirm it's fixed?

from mermaid-filter.

raghur avatar raghur commented on August 21, 2024

hmm - I used your test diagram to verify and added it to test.md.

Can you confirm that you see a mermaid-filter.err being created (this is stderr being redirected to a file). Pandoc does not like it if there's anything on stdout other than valid pandoc JSON and hangs otherwise.

Also, can you confirm index.js file contents and that it's the right one being invoked?

from mermaid-filter.

lopezator avatar lopezator commented on August 21, 2024

I add another example @raghur, the following mermaid code, enclosed in a TEST.md file.

graph TD
  subgraph "Destination"
    Foo
  end
Loading

Along with the following pandoc command:

MERMAID_FILTER_FORMAT='svg' pandoc --verbose -V geometry:margin=1in --highlight-style haddock --standalone --self-contained --toc --top-level-division=chapter -f markdown -t latex -F mermaid-filter -o my-pdf.pdf TEST.md

Creates an empty mermaid-filter.err file when executed and still hangs forever.

from mermaid-filter.

raghur avatar raghur commented on August 21, 2024

So this seems to be a slightly different manifestation of the same issue.

For the original issue you reported, I added it to the test.md that's in the repository and can be tested.

This new example with the subgraph and it does hang and there's nothing in the err file either.
Do note that I'm unable to run your command as is - I'm testing with just

pandoc -i test.md -F mermaid-filter.cmd -t html -o test.html

I'll look into this more when I get time.

from mermaid-filter.

lopezator avatar lopezator commented on August 21, 2024

We are using mermaid filter to automatically generate pdf's on a markdown repository ci builds and sometimes builds hang forever on CI because of this.

By the way, thank you @raghur for the help and your awesome work, I wish I could help with this, but I know nothing about JS.

from mermaid-filter.

lopezator avatar lopezator commented on August 21, 2024

Hello @raghur we have found another problematic usecase.

If you write a simple mermaid graph LR like this:

graph LR
A --> B --> C --> D

The tool also creates an empty mermaid-filter.err file, and hangs forever.

I don't know if the cause could be the same or not, but this might be another good scenario to test.

In order to make this work and get the same output, we had to rewrite all of our graphs to include just a "command" per line like this:

graph LR
A --> B
B --> C
C --> D

from mermaid-filter.

faxik avatar faxik commented on August 21, 2024

This hit us today, as well... Did you have a time to look into it? Thank you for your work!

from mermaid-filter.

raghur avatar raghur commented on August 21, 2024

See - mermaidjs/mermaid.cli#77

Both for this example and for the previous one with a subgraph quote, mermaid.cli errors out with a parse error and hangs.
Its strange though since the live editor does not report a problem with A --> B --> C -->D or with the earlier example of subgraph with quotations.

from mermaid-filter.

faxik avatar faxik commented on August 21, 2024

I confirm that with 8.4.4 no hangs occur.

from mermaid-filter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.