Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Without Chromium Dependencies #41

Closed
pb-seiso opened this issue Aug 27, 2020 · 3 comments
Closed

Running Without Chromium Dependencies #41

pb-seiso opened this issue Aug 27, 2020 · 3 comments
Assignees

Comments

@pb-seiso
Copy link

pb-seiso commented Aug 27, 2020

I posted this question to the main mermaid repo two months ago without any response: mermaid-js/mermaid#1494

Please let me know if the issue should remain there, or if this is the best place to handle it.

========================================================

I'm attempting to install and run Mermaid in a light-weight Docker container running Ubuntu 20.04.

When interacting with the container and running mmdc, I'm receiving the following error originating from Puppeteer: UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
Full error: runtime_error.txt

From the package.json, Puppeteer is a dev dependency only. When installing Mermaid and Mermaid CLI using yarn add, I do not specify inclusion of development dependencies.

ARG MERMAID_VERSION="8.5.2"
ARG MERMAID_CLI_VERSION="8.5.1-2"
RUN yarn add mermaid@${MERMAID_VERSION} \
             @mermaid-js/mermaid-cli@${MERMAID_CLI_VERSION}

The following entry is in the yarn.lock, which does not specify Puppeteer as a dependency:

[email protected]:
  version "8.5.2"
  resolved "https://registry.yarnpkg.com/mermaid/-/mermaid-8.5.2.tgz#0f1914cda53d4ea5377380e5ce07a38bef2ea7e8"
  integrity sha512-I+s+8/RzlazF3dGOhDUfU/ERkUV4zfIlTWb3703jNx+2lfACs+4AdY9ULQaw6BPWzW3gB+XlXFOOX/m/vqujIA==
  dependencies:
    "@braintree/sanitize-url" "^3.1.0"
    crypto-random-string "^3.0.1"
    d3 "^5.7.0"
    dagre "^0.8.4"
    dagre-d3 "^0.6.4"
    entity-decode "^2.0.2"
    graphlib "^2.1.7"
    he "^1.2.0"
    minify "^4.1.1"
    moment-mini "^2.22.1"
    scope-css "^1.2.1"

I've tried adding the --prod or --production=true flags to to the yarn add, but mmdc still fails with the same issue. It seems the only way to avoid the error is to include all of the many Chromium dependencies that Puppeteer requires, and then it runs successfully.

Is there any way to avoid pulling in these dependencies just to run mmdc? I'm unfamiliar with yarn, so please let me know if I've missed something.

@MindaugasLaganeckas
Copy link
Member

@pb-seiso : thank you for your question. I have myself joined mermaid organization only recently (~5 months ago) and I am myself not an expert in TypeScript/Puppeteer area. I have had the same problem, when building official mermaid-cli docker image. You can have a look here: https://github.com/mermaid-js/mermaid-cli/blob/master/Dockerfile
Unfortunately, (to my understanding) the dependencies, you are talking about, are not for the mmdc itself: they are needed for the mermaid core library to run. Mermaid-cli is an extremely thin layer over mermaid, that does not really add new extra dependencies. So your initial attempt to post a question in the mermaid repository was the right place.
Just for your information, we do release mermaid-cli into the docker.com: https://hub.docker.com/r/minlag/mermaid-cli
@knsv : please, comment on the issue above when you get the time.

@MindaugasLaganeckas MindaugasLaganeckas self-assigned this Aug 28, 2020
@pb-seiso
Copy link
Author

Thanks for the quick response and acknowledgment @MindaugasLaganeckas. I'm happy to close this after we've received the requested comments.

@MindaugasLaganeckas
Copy link
Member

@pb-seiso : no problem! Could you, please, close the issue then? 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants