When I run Puppeteer on Cloud Functions with Node 8, I get this error.
Error: Failed to launch chrome!
[1205/063825.588245:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
Launching Puppeteer with
browser = await puppeteer.launch({
args: ['--no-sandbox'],
headless: true
})
solves the issue. I have searched on the internet and could not find any reason why is this necessary?
Why does Headless Chrome run as root in the first place?