Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Puppeteer on Heroku: Failed to launch the browser process

I'm using Puppeteer on Heroku and I receive the following error:

Failed to launch the browser process! /usr/src/app/node_modules/puppeteer/.local-chromium/linux-756035/chrome-linux/chrome: error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directory TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md
like image 498
Bakr Avatar asked Dec 01 '22 09:12

Bakr


1 Answers

  1. Declare browser as:

    const browser = await puppeteer.launch({
                      headless: true,
                      args: ['--no-sandbox','--disable-setuid-sandbox']
                    })
    
  2. Install heroku buildpack puppeteer heroku buildpack

  3. Must clear heroku cache

  4. git add .

  5. git commit -m "some text"

  6. git push heroku master

like image 174
Malek Kamoua Avatar answered Dec 04 '22 06:12

Malek Kamoua