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 #1494

Closed
pb-seiso opened this issue Jun 22, 2020 · 5 comments
Closed

Running Without Chromium Dependencies #1494

pb-seiso opened this issue Jun 22, 2020 · 5 comments
Labels
Area: DevOps Status: Triage Needs to be verified, categorized, etc Type: Other Not an enhancement or a bug

Comments

@pb-seiso
Copy link

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.

@pb-seiso pb-seiso added Contributor needed Type: Other Not an enhancement or a bug labels Jun 22, 2020
@github-actions github-actions bot added the Status: Triage Needs to be verified, categorized, etc label Jun 22, 2020
@VincentTam
Copy link

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

It's better to choose Alpine Linux if you want your Docker image to be lightweight.

@JonZeolla
Copy link

Any update on this?

@pb-seiso
Copy link
Author

pb-seiso commented Dec 7, 2020

Has there been any work done on this? Mermaid isn't currently viable for my image with the extra 600 MB in dependencies that get pulled.

@jgreywolf jgreywolf added Type: Question Area: DevOps Type: Other Not an enhancement or a bug and removed Contributor needed Type: Other Not an enhancement or a bug Type: Question labels Feb 2, 2021
@DanInProgress
Copy link
Contributor

This has definitely been a pain-point for me, and looks like some new discussion has opened up about this on #3650 ,
if I have time I'm going to try to experiment with this some time in the next month. (maybe too little, too late for your use)

Seems like this issue has gone a bit stale, and is duplicated by discussion on #3650 , so might be worth closing this and continuing conversation over there? @pb-seiso

@jgreywolf
Copy link
Contributor

Closing as duplicate of #3650

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: DevOps Status: Triage Needs to be verified, categorized, etc Type: Other Not an enhancement or a bug
Projects
None yet
Development

No branches or pull requests

5 participants