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: fix isNode variable not properly detecting Node.js environment #6148

Merged
merged 1 commit into from Jul 3, 2020
Merged

fix: fix isNode variable not properly detecting Node.js environment #6148

merged 1 commit into from Jul 3, 2020

Conversation

wojtekmaj
Copy link
Contributor

This patch fixes Node.js being detected by the lack of global.document which isn't necessairly always true in Node.js (example: using JSDOM library). Instead, we're now detecting process.versions.node being present, which I copied over from here.

Fixes #6147

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@wojtekmaj
Copy link
Contributor Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Jul 3, 2020
@mathiasbynens
Copy link
Member

Please fix the lint check by running prettier

This patch fixes Node.js being detected by the lack of `global.document` which isn't necessairly always true in Node (example: using JSDOM library). Instead, we're now detecting `process.versions.node` being present, which I copied over from [here](https://github.com/MatthewSH/is-node/commit/426943ae936536f9c2fd10fd58a9a46b59470097#diff-168726dbe96b3ce427e7fedce31bb0bc).

Fixes #6147
@wojtekmaj
Copy link
Contributor Author

@marcjansen Done - sorry about that, VSCode linting didn't kick in since I installed the repo for the first time after opening VSCode :)

@mathiasbynens
Copy link
Member

Not sure why @marcjansen would care to be honest 😅 Thanks for the fix-up!

@mathiasbynens mathiasbynens merged commit aee8fda into puppeteer:main Jul 3, 2020
@wojtekmaj wojtekmaj deleted the fix-is-node branch July 3, 2020 09:02
@marcjansen
Copy link
Contributor

Of course I care, ;-)

@fgfmichael
Copy link

@mathiasbynens hey I'm actually having this issue which is how I found this, I can see this was merged 7 days ago and 5.0.0 was released 8 days ago, when abouts is this planned to release?

Cheers :)

@mathiasbynens
Copy link
Member

Hey @fgfmichael, we don't have a fixed release schedule but rest assured this will be in a proper release soon.

Until then, you can npm install puppeteer/puppeteer to use the unreleased bleeding-edge version.

@wojtekmaj
Copy link
Contributor Author

For those following this thread - this fix is live as of v5.1.0.

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.

New debug function spams console.logs when used with Jest
5 participants