question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error when generating mermaid graph through mmdc

See original GitHub issue

When using mermaid as a graph tools, with its CLI, I have the following error in the IDEA UI:

image

The mmdc command line has its hashbang defined like this:

#!/usr/bin/env node
...

From my point of view, the IDE doesn’t find node, but don’t know how to check if the path variable is accessible from the plugin context.

The preview pane looks like this image

For the following document, which is pretty simple:

= Example
:mermaid: /usr/local/bin/mmdc

[mermaid, communications, png, css="mermaid.css"]
----
graph TD
  A --> B
----

More:

  • the mmdc comand is availaible in the $PATH
  • the node command is available in the $PATH
AsciiDoc Plugin Version: 0.30.6

IDE Version: 
IntelliJ IDEA 2019.2.2 (Ultimate Edition)
Build #IU-192.6603.28, built on September 6, 2019
Subscription is active until April 3, 2020
Runtime version: 1.8.0_202-release-b1491 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.6
GC: ParNew, ConcurrentMarkSweep
Memory: 1450M
Cores: 8
Registry: 
Non-Bundled Plugins: Key Promoter X, Lombook Plugin, com.jetbrains.jbre.bintray.downloader, mobi.hsz.idea.gitignore, net.sjrx.intellij.plugins.systemdunitfiles, org.asciidoctor.intellij.asciidoc, org.jetbrains.plugins.go-template, BashSupport, com.intellij.plugins.html.instantEditing, izhangzhihao.rainbow.brackets, org.intellij.scala, com.intellij.kubernetes

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
davinkevincommented, Oct 7, 2019

I did not have the chance to test it before today…

I choose to use the following command (run in bash):

sudo launchctl config user path $PATH

And this is working perfectly 👍

0reactions
dfrommicommented, Jun 5, 2022

@WuglyakBolgoink I have the same issue and could resolve it like this…

Add document attribute mmdc to tell the plugin where to find the executable

:mmdc: /usr/local/bin/mmdc

Edit the file /usr/local/bin/mmdc to point to the absolute path of node, rather than using env. Top of mmdc file then reads

#!/usr/local/bin/node

This will of course be reverted on any update of mmdc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MMDC not found in mermaid.cli
I tried to use gatsby-remark-draw to render mermaid diagrams which includes installing mermaid and mermaid.cli . However, the diagram ...
Read more >
remark-mermaid-dataurl
A remark markdown plugin that renders mermaid markdown code into SVG data URLs using mermaid-cli. Designed for use with Docusaurus v2.
Read more >
mermaid.cli | Yarn - Package Manager
Command-line interface for mermaid. This CLI tool takes a mermaid definition file as input and generates svg/png/pdf file as output. Install locally. Some ......
Read more >
mermaid
It calls out to the 'mmdc' executable to generate SVGs. ... Its raw contents are the plain text of the Mermaid diagram.
Read more >
foliantcontrib.mermaid
This preprocessor converts Mermaid diagram definitions in your Markdown files into images ... cache_dir : Path to the directory with the generated diagrams....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found