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

Do not accept quoted subgraph #59

Closed
phuongnd08 opened this issue Jul 6, 2019 · 3 comments
Closed

Do not accept quoted subgraph #59

phuongnd08 opened this issue Jul 6, 2019 · 3 comments

Comments

@phuongnd08
Copy link

I installed mermaid.cli with latest mermaidjs. Here is my package.json

{
  "dependencies": {
    "mermaid.cli": "^0.5.1",
    "mermaid": "knsv/mermaid#f506c795"
  }
}

Attempting to render something like this:

graph TD
  subgraph "groupA1"
    balancer[Balancer] --> backend[Backend]
    balancer --> frontend[Frontend]
  end

Failed with this:

$ /Users/phuongnd08/code/maps/node_modules/.bin/mmdc -i sample.mmd -o sample.pdf
(node:48326) UnhandledPromiseRejectionWarning: Error: Evaluation failed: Error: Parse error on line 2:
...raph TD  subgraph "groupA1"    balance
----------------------^
Expecting 'SEMI', 'NEWLINE', 'SPACE', 'EOF', 'GRAPH', 'DIR', 'TAGEND', 'TAGSTART', 'UP', 'DOWN', 'subgraph', 'end', 'SQE', 'PE', '-)', 'DIAMOND_STOP', 'MINUS', '--', 'ARROW_POINT', 'ARROW_CIRCLE', 'ARROW_CROSS', 'ARROW_OPEN', 'DOTTED_ARROW_POINT', 'DOTTED_ARROW_CIRCLE', 'DOTTED_ARROW_CROSS', 'DOTTED_ARROW_OPEN', '==', 'THICK_ARROW_POINT', 'THICK_ARROW_CIRCLE', 'THICK_ARROW_CROSS', 'THICK_ARROW_OPEN', 'PIPE', 'STYLE', 'LINKSTYLE', 'CLASSDEF', 'CLASS', 'CLICK', 'DEFAULT', 'NUM', 'PCT', 'COMMA', 'ALPHA', 'COLON', 'BRKT', 'DOT', 'PUNCTUATION', 'UNICODE_TEXT', 'PLUS', 'EQUALS', 'MULT', got 'STR'
    at Yt.parseError (file:///Users/phuongnd08/code/maps/node_modules/mermaid.cli/mermaid.min.js:1:486512)
    at Yt.parse (file:///Users/phuongnd08/code/maps/node_modules/mermaid.cli/mermaid.min.js:1:487678)

Also apparently mermaid.cli is using its bundled version of mermaid.min.js. It should have used the mermaid specified by package.json

@phuongnd08 phuongnd08 reopened this Jul 6, 2019
@cu12
Copy link

cu12 commented Jul 8, 2019

@phuongnd08 not so great, but as a workaround, you could create your package.json with similar content to this until, there'll be a release with updated mermaid.js

  "scripts": {
    "postinstall": "cp -f ./node_modules/mermaid/dist/mermaid.min.js ./node_modules/mermaid.cli/"
  },
  "dependencies": {
    "mermaid": "^8.1.0",
    "mermaid.cli": "^0.5.1"
  }

johnandersen777 pushed a commit to johnandersen777/dffml that referenced this issue Sep 25, 2019
Relavent MermaidJS issues:
- Fix clipping
  - mermaidjs/mermaid.cli#59
- Fix CLI not working
  - mermaid-js/mermaid#790 (comment)

Signed-off-by: John Andersen <john.s.andersen@intel.com>
@Kochise
Copy link

Kochise commented Nov 12, 2020

@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

4 participants