Coder Social home page Coder Social logo

Comments (9)

tyler-graham-ck avatar tyler-graham-ck commented on April 28, 2024 3

In the meantime it appears that running node ./node_modules/playwright/install.js before executing your tests will download the binaries if necessary

from playwright.

JoelEinbinder avatar JoelEinbinder commented on April 28, 2024 2

Thanks for joining us on the bleeding edge!

Did you run both npm install and node test.ts from within WSL? Installing from windows but running from within WSL, or vice versa, would probably cause this error.

Assuming your WSL is Ubuntu based, you probably need to get Chrome's dependencies. It looks like we are missing the list of what those dependencies actually are, but I'd try

sudo apt install \
    gconf-service \
    libasound2 \
    libatk1.0-0 \
    libatk-bridge2.0-0 \
    libc6 \
    libcairo2 \
    libcups2 \
    libdbus-1-3 \
    libexpat1 \
    libfontconfig1 \
    libgcc1 \
    libgconf-2-4 \
    libgdk-pixbuf2.0-0 \
    libglib2.0-0 \
    libgtk-3-0 \
    libnspr4 \
    libpango-1.0-0 \
    libpangocairo-1.0-0 \
    libstdc++6 \
    libx11-6 \
    libx11-xcb1 \
    libxcb1 \
    libxcomposite1 \
    libxcursor1 \
    libxdamage1 \
    libxext6 \
    libxfixes3 \
    libxi6 \
    libxrandr2 \
    libxrender1 \
    libxss1 \
    libxtst6 \
    ca-certificates \
    fonts-liberation \
    libappindicator1 \
    libnss3 \
    lsb-release \
    xdg-utils \
    wget

You can also launch with the dumpio: true option, to see if there is something helpful being logged by the browser itself.

from playwright.

joshsaintjacque avatar joshsaintjacque commented on April 28, 2024 1

@JoelEinbinder Thanks for your timely response!

I was able to track down the issue. The problem appears to be with Chromium's sandbox. I found some troubleshoot docs from Puppeteer that gave the hint.

I've been unable to get a Chrome sandbox on WSL, but if I disable sandbox (which isn't ideal) it does work:

const browser = await pw.chromium.launch({ args: ['--no-sandbox', '--disable-setuid-sandbox'] });

Edit: I should note that this only works for Chromium. Firefox continues to throw the cryptic UnhandledPromiseRejectionWarning: Error: Failed to launch browser!.

I'm able to get a little more out of Webkit, it throws:

UnhandledPromiseRejectionWarning: Error: Failed to launch browser: Error: spawn /mnt/c/Users/joshs/repos/pw-test/node_modules/playwright-core/.local-webkit/linux-1106/pw_run.sh ENOENT
    at ChildProcess.spawnedProcess.once.error (/mnt/c/Users/joshs/repos/pw-test/node_modules/playwright-core/lib/server/processLauncher.js:49:20)
    at Object.onceWrapper (events.js:285:13)
    at ChildProcess.emit (events.js:197:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:252:12)
    at onErrorNT (internal/child_process.js:421:16)
    at processTicksAndRejections (internal/process/next_tick.js:76:17)
  ...

from playwright.

FezVrasta avatar FezVrasta commented on April 28, 2024 1

To add more details, it seems to be a problem with Yarn. npm seems to reliably download the browser binaries every time.

from playwright.

butlersrepos avatar butlersrepos commented on April 28, 2024

@JoelEinbinder Those helped me over this hurdle but just wanted to point out that a preliminary

sudo apt-get update

may be needed

from playwright.

FezVrasta avatar FezVrasta commented on April 28, 2024

I get the same Error: Chromium revision is not downloaded. Run "npm install" at Chromium.launchBrowserApp (/home/travis/build/popperjs/popper-core/node_modules/playwright-core/lib/server/chromium.js:70:23) on macOS and Travis, the only solution is to delete node_modules and yarn again.

from playwright.

pavelfeldman avatar pavelfeldman commented on April 28, 2024

Folding this into #581 and #1085

from playwright.

pavelfeldman avatar pavelfeldman commented on April 28, 2024

Folding into #1103

from playwright.

charliedeus avatar charliedeus commented on April 28, 2024

Caso ajude alguém, encontrei o apoio necessário em: https://askubuntu.com/questions/1204571/how-to-install-chromium-without-snap

from playwright.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.