Error starting Chrome with puppeteer when deploying headless-chrome functions example
See original GitHub issueI was looking at the documentation for Cloud Functions (https://cloud.google.com/functions/docs/concepts/nodejs-10-runtime) and wanted to deploy one of the example functions in this repo, the headless-chrome
example. My deploy command was based on what I was reading in the docs site:
gcloud functions deploy screenshot --runtime nodejs10 --trigger-http --project <redacted>
The deploy succeeds, but then in the web browser when I visit the URL, the function displays the expected message if I don’t provide the URL query string parameter:
?url=https://example.com
Please provide URL as GET parameter, for example:
But it fails if I do provide a URL query string parameter, displaying the following message in the browser:
Error: could not handle the request
And the following message in the Stackdriver logs for the function:
TimeoutError: Timed out after 30000 ms while trying to connect to Chrome! The only Chrome revision guaranteed to work is r672088 at Timeout.onTimeout (/srv/functions/node_modules/puppeteer/lib/Launcher.js:351:14) at ontimeout (timers.js:436:11) at tryOnTimeout (timers.js:300:5) at listOnTimeout (timers.js:263:5) at Timer.processTimers (timers.js:223:10)
Despite the error message mentioning “30000 ms”, this happens within a few seconds.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Web Scraping with a Headless Browser: A Puppeteer Tutorial
In this article, Toptal Freelance JavaScript Developer Nick Chikovani shows how easy it is to perform web scraping using a headless browser.
Read more >Puppeteer throws launch exception when deployed on azure ...
So we can use the package puppeteer in Azure function. ... browser = await puppeteer.launch({ headless: true }); const page = await browser....
Read more >Creating a Puppeteer microservice to deploy to Google Cloud ...
First, we launch a Chrome instance and pass the headless: false argument to display it instead of running it headless without the GUI....
Read more >Running headless Chromium in Azure Functions with ...
Browser automation has been around for a long time. Selenium WebDriver was a pioneer in this space. More recently, Puppeteer and Playwright have ......
Read more >How to Use Puppeteer to Automate Chrome in an API with ...
How can we use Puppeteer in a serverless function on Netlify? Puppeteer works both with opening a visible browser UI and “headless”, meaning,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I confirm that the OS packages needed to run Headless Chrome (and thus puppeteer) will keep being present in the Cloud Functions environment.
HI! I noticed that the examples were removed a few days ago in https://github.com/GoogleCloudPlatform/nodejs-docs-samples/pull/1461.
Is Puppeteer still supported in Cloud Functions?