question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Cannot install chromium on Cloud Functions

See original GitHub issue

Context:

  • 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:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
sakebookcommented, Nov 21, 2020

You tell it not to download Playwright, so it doesn’t. And then it can’t launch!

I’m using PLAYWRIGHT_BROWSERS_PATH, not PLAYWRIGHT_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

0reactions
pavelfeldmancommented, Jul 12, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found