question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!

See original GitHub issue

Steps to reproduce

Tell us about your environment:

I already install Ubuntu dependencies by below command.

sudo apt-get install gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

What steps will reproduce the problem?

Please include code that reproduces the issue.

  1. Run const browser = await puppeteer.launch();
  2. Error occured.

What is the expected result?

Launch the chrome.

What happens instead?

(node:9952) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome! /home/odroid/Programs/KoreanSchool-ScheduleBot/node_modules/korean-school/node_modules/puppeteer/.local-chromium/linux-549031/chrome-linux/chrome: 1: /home/odroid/Programs/KoreanSchool-ScheduleBot/node_modules/korean-school/node_modules/puppeteer/.local-chromium/linux-549031/chrome-linux/chrome: Syntax error: Unterminated quoted string

TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

at onClose (/home/odroid/Programs/KoreanSchool-ScheduleBot/node_modules/korean-school/node_modules/puppeteer/lib/Launcher.js:255:14)
at Interface.helper.addEventListener (/home/odroid/Programs/KoreanSchool-ScheduleBot/node_modules/korean-school/node_modules/puppeteer/lib/Launcher.js:244:50)
at Interface.emit (events.js:130:15)
at Interface.close (readline.js:379:8)
at Socket.onend (readline.js:152:10)
at Socket.emit (events.js:130:15)
at endReadableNT (_stream_readable.js:1101:12)
at process._tickCallback (internal/process/next_tick.js:152:19)

(node:13165) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:13165) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:20 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
cfgscommented, Apr 13, 2020

If you are running an ARM processor, e.g. Raspberry PI, as stated in the begning of this thread I solved the issue with the following:

Install Chromium by running: sudo apt install chromium-browser chromium-codecs-ffmpeg

It usually installes Chromium in /usr/bin/ -folder. So then we change the executablePath to the below:

  const browser = await puppeteer.launch({
          headless: true,
          executablePath: '/usr/bin/chromium-browser',
          args: ['--no-sandbox', '--disable-setuid-sandbox']
  });

4reactions
aslushnikovcommented, May 3, 2018

@KevinNovak pptr doesn’t support ARM out of the box. You’ll have to compile chromium for arm on your own and point pptr to use it with executablePath

Sent with GitHawk

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to launch chrome #807 - puppeteer/puppeteer - GitHub
When I deployed in my EC2 I am getting this error. Couldn't find a past issue related to this. What happens instead? It...
Read more >
Can't Use Puppeteer -- Error: Failed to launch chrome
If you encounter E: Unable to locate package errors, run sudo apt-get update . ... under Chrome headless doesn't launch on UNIX you...
Read more >
Troubleshooting - Puppeteer
UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process! This means that the browser was downloaded but failed to be extracted correctly.
Read more >
Internal browser error: Failed to launch the browser process!
Internal browser error: Failed to launch the browser process!
Read more >
Failed to launch the browser process! - DigitalOcean
How can I use chrome for puppeteer in my nodejs application on the Apps Platform? (node:27) UnhandledPromiseRejectionWarning: Error: Failed ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found