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

You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection #6

Closed
gustavomc opened this issue May 14, 2018 · 7 comments

Comments

@gustavomc
Copy link

 Error: Failed to launch chrome! spawn /app/node_modules/puppeteer/.local-chromium/linux-555668/chrome-linux/chrome ENOENT
 TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
     at onClose (/app/node_modules/puppeteer/lib/Launcher.js:255:14)
     at ChildProcess.helper.addEventListener.error (/app/node_modules/puppeteer/lib/Launcher.js:246:64)
     at emitOne (events.js:116:13)
     at ChildProcess.emit (events.js:211:7)
     at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)
     at onErrorNT (internal/child_process.js:372:16)
     at _combinedTickCallback (internal/process/next_tick.js:138:11)
     at process._tickDomainCallback (internal/process/next_tick.js:218:9)```
@etienne-martin
Copy link
Owner

Are you trying to run svg-to-img inside of Docker or Debian?

@gustavomc
Copy link
Author

Yes @etienne-martin inside a docker container running an alpine image.

@etienne-martin
Copy link
Owner

I got it working by adding the following to my Dockerfile:

# See https://crbug.com/795759
RUN apt-get update && apt-get install -yq libgconf-2-4 ssh git-all

# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)
# Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer
# installs, work.
RUN apt-get update && apt-get install -y wget --no-install-recommends \
    && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
    && apt-get update \
    && apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont \
      --no-install-recommends \
    && rm -rf /var/lib/apt/lists/* \
    && rm -rf /src/*.deb

Take a look at https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker for more information.

Let me know if it helped!

@gustavomc
Copy link
Author

Thanks @etienne-martin i'll try it.

@gustavomc
Copy link
Author

gustavomc commented May 15, 2018

hi @etienne-martin, now im getting this error:

 AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install" or "yarn install"
     at Console.assert (console.js:191:23)
     at Function.launch (/app/node_modules/svg-to-img/node_modules/puppeteer/lib/Launcher.js:100:15)
     at <anonymous>

Do you know what possibly be?

Thanks.

@etienne-martin
Copy link
Owner

Can you docker exec into the container and verify if you see the ./node_modules/svg-to-img/node_modules/puppeteer/.local-chromium/ folder?

Also make sure that you run npm install from inside the docker container. Otherwise it will install the macOS version of chromium if you're on an apple computer.

@etienne-martin
Copy link
Owner

This might be helpful: puppeteer/puppeteer#1761

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