Playwright chrome browser fails on Apify platform
I have a scraper using Playwright, which still works perfectly locally. It also used to work on Apify, but since today it no longer does.
Has anything been changed about how Playwright is ran on Apify? The error talks about the old Chrome headles mode being removed?
See attachment for the full logs.
Haven't changed anything about the default Dockerfile, here it is:
`
6 Replies
Someone will reply to you shortly. In the meantime, this might help:
Can you try with
headless: "new"
?I tried it like this:
But the headless field is a boolean, not a string, so I get this error:
hmm, interesting. Probably the docker image being pulled on Apify platform is not cached, it installed a chrome version (It installs the latest stable version https://github.com/apify/apify-actor-docker/blob/bd822706bd31148c5dc8d9eebc6998cb2c47ac02/node-playwright-chrome/Dockerfile#L10) without the headless mode which Google said that they'd be splitting the headless mode (where locally it's most likely cached). Are you using a fixed playwright version in
package.json
or is it *
? (I believe you shouldn't use *
as it would install a version that might be incompatible with your setup)correct-apricot•3mo ago
@Louis Deconinck ran into the same problem and fixed it by pinning the playwright version to 1.49.1 in package.json (instead of * which currently installs 1.50.1)
Thanks for confirming @serge This is probably something Apify should take a look at. I no longer have the problem as I was able to improve my scraper which no longer requires Playwright, but others might run into this as well.