Here is what worked for me. First, I clear all my buildpacks and then I added the puppeteer-heroku-buildpack and the heroku/nodejs one:
$ heroku buildpacks:clear
$ heroku buildpacks:add --index 1 https://github.com/jontewks/puppeteer-heroku-buildpack
$ heroku buildpacks:add --index 1 heroku/nodejs
Then, add the following args to the puppeteer launch function:
const browser = await puppeteer.launch({
'args' : [
'--no-sandbox',
'--disable-setuid-sandbox'
]
});
Finally, deploy it back to Heroku:
$ git add .
$ git commit -m "Fixing deployment issue"
$ git push heroku master
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…