Skip to content
This repository has been archived by the owner on Jul 22, 2023. It is now read-only.

mmdc doesn't support stateDiagram? #72

Closed
Synchro opened this issue Nov 20, 2019 · 2 comments
Closed

mmdc doesn't support stateDiagram? #72

Synchro opened this issue Nov 20, 2019 · 2 comments

Comments

@Synchro
Copy link

Synchro commented Nov 20, 2019

I'm trying to use mermaid.cli for generating state diagrams. A minimal state diagram file from the examples:

stateDiagram
    [*] --> Still
    Still --> [*]

run with mmdc -i test.mmd -o test.mmd results in this crash:

(node:68719) UnhandledPromiseRejectionWarning: Error: Evaluation failed: Error: Parse error on line 1:
stateDiagram    [*]
^
Expecting 'NEWLINE', 'SPACE', 'GRAPH', got 'ALPHA'
    at Yt.parseError (file:///Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/mermaid.min.js:1:486512)
    at Yt.parse (file:///Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/mermaid.min.js:1:487678)
    at Object.e.getClasses (file:///Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/mermaid.min.js:1:749437)
    at Object.render (file:///Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/mermaid.min.js:1:759998)
    at s (file:///Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/mermaid.min.js:8:233)
    at Object.init (file:///Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/mermaid.min.js:8:318)
    at __puppeteer_evaluation_script__:17:20
    at ExecutionContext._evaluateInternal (/Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/ExecutionContext.js:122:13)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async ExecutionContext.evaluate (/Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/ExecutionContext.js:48:12)
    at async ElementHandle.evaluate (/Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/JSHandle.js:55:12)
    at async ElementHandle.$eval (/Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/JSHandle.js:478:20)
  -- ASYNC --
    at ExecutionContext.<anonymous> (/Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/helper.js:111:15)
    at ElementHandle.evaluate (/Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/JSHandle.js:55:42)
    at ElementHandle.<anonymous> (/Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/helper.js:112:23)
    at ElementHandle.$eval (/Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/JSHandle.js:478:40)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
  -- ASYNC --
    at ElementHandle.<anonymous> (/Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/helper.js:111:15)
    at DOMWorld.$eval (/Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/DOMWorld.js:156:21)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
  -- ASYNC --
    at Frame.<anonymous> (/Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/helper.js:111:15)
    at Page.$eval (/Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/Page.js:347:29)
    at Page.<anonymous> (/Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/helper.js:112:23)
    at /Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/index.bundle.js:83:14
    at Generator.next (<anonymous>)
    at step (/Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/index.bundle.js:4:191)
    at /Users/me/.nvm/versions/node/v12.13.1/lib/node_modules/mermaid.cli/index.bundle.js:4:361
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:68719) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:68719) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

It actually hangs at this point and requires a ctrl-C to exit.

Is this because mermaid.cli bundles an old version of the library that doesn't support state diagrams, as mentioned in #71 ?

@Synchro Synchro changed the title Doesn't support stateDiagram? mmdc doesn't support stateDiagram? Nov 20, 2019
@Voto
Copy link

Voto commented Nov 25, 2019

I just ran into the same issue. Seems there is no more activity on this repo :-(
I will try to render the my graphs as graph LR @Synchro

Update: I finally made beautiful state diagrams with plantUML. Their cli works fine @Synchro

@aloisklink
Copy link
Collaborator

Development has moved to the https://github.com/mermaid-js/mermaid-cli repo, please re-open your issue there if it's still relevant.
The package has also been renamed on NPM to @mermaid-js/mermaid-cli, so you may need to run npm uninstall mermaid.cli && npm install @mermaid-js/mermaid-cli to get the latest version of this package.

@aloisklink aloisklink closed this as not planned Won't fix, can't repro, duplicate, stale Jul 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants