Context:
Chromium doesn鈥檛 work with Playwright on Heroku even with the recommended puppeteer build pack that worked with Playwright 0.9. Details and discussion in #634
To reproduce, use this repo and change the Playwright version: https://github.com/diervo/testing-heroku-playwright
Any updates on this? Having the same issue.
EDIT: https://github.com/microsoft/playwright/issues/2205
Make sure the --no-sandbox flag is set when running on heroku. Everything seems to be working fine on heroku with the latest version of playwright and the the build pack.
const browser = await chromium.launch({headless: true, args: ['--no-sandbox']});
Thanks for checking this @wisbell. Can you share more info on your Heroku config (e.g., which buildpack are you using)? We'd love to add it to the docs for other users.
Buildpack: https://github.com/jontewks/puppeteer-heroku-buildpack
And of course whatever nodejs buildpack heroku automatically adds.
The package.json for the library I am using has this playwright version: "playwright": "^0.15.0"
@arjun27 assigning to make sure it is in the docs and can be closed.
@Wisbell I'm doing exactly the same steps, and it's not working.
In fact the only difference is that I am using firefox, and unfortunately I need to use it.
const { firefox } = require("playwright");
const browser = await firefox.launch({
headless: true,
args: ["--no-sandbox", "--disable-setuid-sandbox"],
});
@pcborges I've created a Heroku buildpack for running Playwright including Chromium and Firefox on Heroku, let me know if it fits for your needs: https://github.com/mxschmitt/heroku-playwright-buildpack/
cc @peter @Wisbell
@mxschmitt It worked very well, I just needed to remove the playwright package and install playwright-firefox as in your example, and added your buildpack before nodejs.
Thank you so much for your help.
Most helpful comment
@mxschmitt It worked very well, I just needed to remove the playwright package and install playwright-firefox as in your example, and added your buildpack before nodejs.
Thank you so much for your help.