[BUG] Cannot install chromium on Cloud Functions
See original GitHub issueContext:
- Playwright Version: v1.6.1
- Operating System: Linux
- Node.js version: v12.18.4
- Browser: Chromium
- Extra: PLAYWRIGHT_BROWSERS_PATH=0
Code Snippet
const playwright = require('playwright-chromium');
exports.capture = (req, res) => {
capturePage(res)
};
function capturePage(res) {
(async () => {
const browser = await playwright.chromium.launch({
args: ["--no-sandbox"],
});
const page = await browser.newPage();
await page.goto('http://whatsmyuseragent.org/');
await page.screenshot({ path: `/tmp/example.png` });
await browser.close();
})();
}
Describe the bug
I tried three libraries with Node 12.
- puppeteer
- playwright-aws-lambda
- playwright-chromium
puppeteer and playwright-aws-lambda are work fine.
playwright-chromium is not work.
I guess download failed.
Error
2020-11-15 18:46:06.530 JSTcapturema7fim0d6js8 browserType.launch: Failed to launch chromium because executable doesn't exist at /workspace/node_modules/playwright-chromium/.local-browsers/chromium-823944/chrome-linux/chrome
browserType.launch: Failed to launch chromium because executable doesn't exist at /workspace/node_modules/playwright-chromium/.local-browsers/chromium-823944/chrome-linux/chrome
2020-11-15 18:46:06.530 JSTcapturema7fim0d6js8 Try re-installing playwright with "npm install playwright"
I use environment variables
- PLAYWRIGHT_BROWSERS_PATH=0
Any solution?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
node.js - Cloud Functions Puppeteer cannot open browser
As far as I can tell the problem is that the build step installs the Chrome browser needed for Puppeteer in a cache...
Read more >Troubleshooting Cloud Functions - Google Cloud
User with Project Viewer or Cloud Function role cannot deploy a function ... This error indicates that there was a problem with your...
Read more >Troubleshooting - Puppeteer
Make sure all the necessary dependencies are installed. You can run ldd chrome | grep not on a Linux machine to check which...
Read more >Call functions via HTTP requests | Cloud Functions for Firebase
You can trigger a function through an HTTP request by using functions.https . This allows you to invoke a synchronous function through the...
Read more >Can not access Amazon.com, url is visible but page is blank ...
The problem is almost certainly because of Chrome's use of IE "Internet Properties". I can't load Amazon in IE 9, 64 bit on...
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’m using
PLAYWRIGHT_BROWSERS_PATH
, notPLAYWRIGHT_SKIP_BROWSER_DOWNLOAD
.I think
PLAYWRIGHT_BROWSERS_PATH=0
mean install to node_modules/${PACKAGE}/.local-browsers.https://github.com/microsoft/playwright/blob/master/docs/api.md#environment-variables
I’ll close this as a part of the bug triaging process. We have hundreds of bugs and feature requests with dozens and even hundreds of upvotes, while this one only has a few thumbs up. Please feel free to open a new bug and link this one if you’d like to see it addressed.