Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(launcher): output correct error message for browser #6815

Merged
merged 3 commits into from Feb 4, 2021

Conversation

jackfranklin
Copy link
Collaborator

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.

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.
src/node/Launcher.ts Outdated Show resolved Hide resolved
Co-authored-by: Mathias Bynens <mathias@qiwi.be>
@jackfranklin jackfranklin enabled auto-merge (squash) February 4, 2021 11:38
@jackfranklin jackfranklin merged commit 6c61874 into main Feb 4, 2021
@jackfranklin jackfranklin deleted the fix-browser-warning branch February 4, 2021 11:59
@SyedMuzamilM
Copy link

Well I am still getting the same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants