0

I've seen a few other questions similar to mine (this Puppeteer unable to run on heroku was helpful) but it doesn't quite solve my problem. I'm using the Markup's Blacklight npm package in a site of mine running on Heroku. When running locally it works perfectly, but on Heroku it doesn't work because a function in that package is what calls Puppeteer so I cannot add these arguments, although I know '--no-sandbox' is an arg.

const browser = await puppeteer.launch({
  args: [
    '--no-sandbox',
    '--disable-setuid-sandbox',
  ],
});

I'm not getting any outright failures, but it tells me my browser = null and I know the data produced is empty.

BeChill
  • 1
  • 4

2 Answers2

0

Could you run the following commands to double check that Google Chrome is properly installed on your Heroku server?

$ heroku run bash --app your-app
$ google-chrome --version

If not, then you can use this buildpack to download and install Chrome on your Heroku.

ryanzidago
  • 358
  • 2
  • 7
0

I figured out the problem. Both adding the buildpack

$ heroku buildpacks:add --index 1 https://github.com/jontewks/puppeteer-heroku-buildpack

and specifying the device to emulate fixed my issue.

BeChill
  • 1
  • 4