seflless/diagrams

CLI hangs on rendering sequence diagrams, but works with flowcharts

jerluc opened this issue · 6 comments

Description

When trying to render the example sequence diagram from the README, the CLI just hangs indefinitely. However, when rendering other kinds of diagrams, such as the flowchart or dot graphs, the CLI runs just fine. I'm not 100% sure as to whether this is a direct bug or an upstream bug in js-sequence-diagrams, as neither has seen a similar issue previously, but I'll just report it here in case @francoislaberge has anymore information that might help solve this issue.

It does look like this is one of the few render implementations that requires a tiny electron window to be opened, so perhaps this is somehow the cause of some issue?

System info

  • Arch Linux (kernel 4.12.8-2)
  • npm v5.3.0

Steps to reproduce

Install CLI

npm install -g diagrams

Create sequence diagram source (input.sequence)

cat > input.sequence <<EOF
Alice->Bob: Hello Bob, how are you?
Note right of Bob: Bob thinks
Bob-->Alice: I am good thanks!
EOF

Run command to render SVG

diagrams sequence input.sequence sequence.svg

Thanks for the good repro steps. I was able to recreate. I think I have it fixed. Try out the latest release: diagrams@0.9.6.

Beautiful! So glad I can finally use this!

@francoislaberge for my own curiosity, what was the underlying issue?

To be honest, I never quite figured it out. I've had this weird issue in the past too, where the main.js you start an electron skill with gets the path to electron instead of the module for electron when you do const electron = require('electron'). In this case, the first thing to fail was:

const app = require('electron').app;

// app is undefined as require('electron') === path to the electron app, thus a string
app.on('blah', ()=>{
}); 

I upgraded from 0.37.0 of electron to 1.3.0 and the issue went away after much debugging and trying to figure it out.

Did you verify that it works for you?

Yes @francoislaberge it works as intended!