puppeteer/src
Jack Franklin 6c61874797
fix(launcher): output correct error message for browser (#6815)
* fix(launcher): output correct error message for browser

When running `npm run release` today I got this error logged:

```
Error: Could not find browser revision 848005. Run "PUPPETEER_PRODUCT=firefox npm install" or "PUPPETEER_PRODUCT=firefox yarn install" to download a supported Firefox browser binary.
    at ChromeLauncher.launch (/Users/jacktfranklin/src/puppeteer/lib/cjs/puppeteer/node/Launcher.js:80:27)
```

The error is only partially correct; I did have the browser revision
missing, but I needed the Chromium browser, not Firefox. It turns out
the logic in `Launcher.ts` didn't take this into account; it mistakenly
had been hardcoded to always log out the error as if the Firefox binary
was missing.

This PR updates the message depending on the browser:

Chrome error:
> Error: Could not find expected browser (chrome) locally. Run npm
> install or yarn install to download the correct Chromium revision
> (848005).

Firefox error:
> Error: Could not find expected browser (firefox) locally. Run
> "PUPPETEER_PRODUCT=firefox npm install" or "PUPPETEER_PRODUCT=firefox
> yarn install" to download a supported Firefox browser binary.

* Update src/node/Launcher.ts

Co-authored-by: Mathias Bynens <mathias@qiwi.be>

Co-authored-by: Mathias Bynens <mathias@qiwi.be>
2021-02-04 11:59:01 +00:00
..
common feat: use captureBeyondViewport in Page.captureScreenshot (#6805) 2021-02-03 14:30:46 +01:00
node fix(launcher): output correct error message for browser (#6815) 2021-02-04 11:59:01 +00:00
.eslintrc.js chore: update eslint & eslint plugins (#6487) 2020-10-12 10:30:35 +01:00
api-docs-entry.ts chore(agnostification): split up root Puppeteer class (#6504) 2020-10-13 16:19:26 +01:00
environment.ts chore: shorter node checker function (#6584) 2020-11-05 07:49:58 +01:00
initialize-node.ts chore(agnostification): split up root Puppeteer class (#6504) 2020-10-13 16:19:26 +01:00
initialize-web.ts chore(agnostification): split up root Puppeteer class (#6504) 2020-10-13 16:19:26 +01:00
node-puppeteer-core.ts chore(agnostification): split up root Puppeteer class (#6504) 2020-10-13 16:19:26 +01:00
node.ts chore(agnostification): split up root Puppeteer class (#6504) 2020-10-13 16:19:26 +01:00
revisions.ts feat(chromium): roll Chromium to r848005 (#6801) 2021-02-02 17:24:10 +01:00
tsconfig.cjs.json chore: vendor Mitt & update project structure (#6209) 2020-07-14 16:57:29 +01:00
tsconfig.esm.json feat(types): expose typedefs to consumers (#6745) 2021-01-13 10:37:35 +01:00
web.ts chore(agnostification): split up root Puppeteer class (#6504) 2020-10-13 16:19:26 +01:00