playwright/packages/playwright-core
Andrey Lushnikov 4ab4c0bda1
feat: detect docker version and Playwright version mismatch (#12806)
This patch prints a friendly instructions in case Docker image version
mismatches Playwright version and there are missing browser
dependencies.

With this patch, Playwright will yield the following error:

```
root@f0774d2b2097:~# node a.mjs
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

browserType.launch:
╔════════════════════════════════════════════════════════════════════════════════════════════╗
║ Host system is missing dependencies to run browsers.                                       ║
║ This is most likely due to docker image version not matching Playwright version:           ║
║ - Playwright: 1.22.0                                                                       ║
║ -     Docker: 1.21.0                                                                       ║
║                                                                                            ║
║ Either:                                                                                    ║
║ - (recommended) use docker image "mcr.microsoft.com/playwright:v1.22.0-focal"              ║
║ - (alternative 1) run the following command inside docker to install missing dependencies: ║
║                                                                                            ║
║     npx playwright install-deps                                                            ║
║                                                                                            ║
║ - (alternative 2) use Aptitude inside docker:                                              ║
║                                                                                            ║
║     apt-get install libgbm1                                                                ║
║                                                                                            ║
║ <3 Playwright Team                                                                         ║
╚════════════════════════════════════════════════════════════════════════════════════════════╝
    at file:///root/a.mjs:3:10 {
  name: 'Error'
}```

Fixes #12796

Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2022-03-25 14:45:53 -07:00
..
bin fix: proper chrome-beta channel installation on MacOS (#11973) 2022-02-09 11:28:51 -08:00
src feat: detect docker version and Playwright version mismatch (#12806) 2022-03-25 14:45:53 -07:00
types chore: add link validation for docs (#13047) 2022-03-25 19:30:45 +01:00
.npmignore chore: migrate trace-viewer and recorder to vite (#13076) 2022-03-25 14:12:00 -07:00
browsers.json feat(webkit): roll to r1621 (#13056) 2022-03-25 08:40:19 -07:00
cli.js chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
index.d.ts chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
index.js chore: verify supported Node.js version during runtime (#10406) 2021-11-19 19:05:17 +01:00
index.mjs chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
package.json chore: cut v1.20 branch (#12593) 2022-03-08 14:01:20 -08:00
README.md chore: drop dependency on playwright-core in all our packages (#2318) 2020-05-21 13:18:15 -07:00

playwright-core

This package contains the no-browser flavor of Playwright.