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

Puppeteer not working with node 14 #5719

Closed
DRoet opened this issue Apr 22, 2020 · 15 comments · Fixed by #5816
Closed

Puppeteer not working with node 14 #5719

DRoet opened this issue Apr 22, 2020 · 15 comments · Fixed by #5816
Labels

Comments

@DRoet
Copy link

DRoet commented Apr 22, 2020

Steps to reproduce

Tell us about your environment:

  • Puppeteer version:3.0.1
  • Platform / OS version:docker (FROM:node:14.0.0-buster)
  • URLs (if applicable):
  • Node.js version: 14.0.0

What steps will reproduce the problem?

Please include code that reproduces the issue.

  1. Upgrade node image from 13.13.0 -> 14.0.0
  2. Run same codebase (puppeteer.launch())

What is the expected result?
code runs without issues, just like on 13.13.0

What happens instead?
Error: Failed to launch the browser process! spawn /opt/app/node_modules/puppeteer/.local-chromium/linux-737027/chrome-linux/chrome ENOENT

@DRoet DRoet changed the title puppeteer not working with node 14 Puppeteer not working with node 14 Apr 22, 2020
@munrocket
Copy link
Contributor

munrocket commented Apr 22, 2020

@DRoet only with node 14? Try 3.0.1-post

@DRoet
Copy link
Author

DRoet commented Apr 22, 2020

@DRoet only with node 14?

yes I just rebuild my images using 12.16.2 and that version also still works

@DRoet
Copy link
Author

DRoet commented Apr 22, 2020

Try 3.0.1-post

how do I install this? doesn't seem to be a valid tag on the registry

@jsoverson
Copy link
Contributor

It looks like it's a problem with extraction. A temporary workaround is to extract the downloaded chromium manually:

$ mv node_modules/puppeteer/.local-chromium/mac-737027 node_modules/puppeteer/.local-chromium/mac-737027.bak 
$ unzip node_modules/puppeteer/.local-chromium/chrome-mac.zip -d node_modules/puppeteer/.local-chromium/mac-737027

@nstepien
Copy link

Likely culprit: max-mapper/extract-zip#94

@jackfranklin
Copy link
Collaborator

Thanks for the debugging all; looks like extract-zip is indeed the culprit here. It would be nice if Puppeteer gave a more helpful message than /opt/app/node_modules/puppeteer/.local-chromium/linux-737027/chrome-linux/chrome ENOENT so I'll try to look into that.

We'll see if a fix lands in extract-zip and do some digging.

@DRoet you can install via the master branch on GitHub to get the very latest.

@jackfranklin
Copy link
Collaborator

It also looks like the suspected bug might have been in Node: nodejs/node#32968.

In which case we may have to sit tight for a Node patch release. In the mean time I'll see if the error message from Puppeteer can be nicer.

jackfranklin added a commit that referenced this issue Apr 24, 2020
There is currently a bug with extract-zip and Node v14.0.0 that
causes extractZip to silently fail:
#5719

Rather than silenty fail if the user is on Node 14 we instead
detect that and throw an error directing the user to that bug. The
rejection message below is surfaced to the user in the command line.

The issue seems to be in streams never resolving so we wrap the call in
a timeout and give it 100ms to resolve before deciding on an error. If
the user is on Node < 14 we maintain the behaviour we had before this
patch.

Here's how this change impacts the output on Node 14 and Node 10:

Node 10:

```
npm run tsc && rm -r .local-* && node install

> puppeteer@3.0.1-post tsc /Users/jacktfranklin/src/puppeteer
> tsc --version && tsc -p . && cp src/protocol.d.ts lib/ && cp src/externs.d.ts lib/

Version 3.8.3
Downloading Chromium r737027 - 118.4 Mb [====================] 100% 0.0s
Chromium (737027) downloaded to /Users/jacktfranklin/src/puppeteer/.local-chromium/mac-737027
```

---

Node 14 without this patch:

```
npm run tsc && rm -r .local-* && node install

> puppeteer@3.0.1-post tsc /Users/jacktfranklin/src/puppeteer
> tsc --version && tsc -p . && cp src/protocol.d.ts lib/ && cp src/externs.d.ts lib/

Version 3.8.3
Downloading Chromium r737027 - 118.4 Mb [====================] 100% 0.0s
```

Note that whilst it doesn't error, it doesn't complete the install. We
don't get the success message that we saw above in the Node 10 install.

---

Node 14 with this patch:

```npm run tsc && rm -r .local-* && node install

> puppeteer@3.0.1-post tsc /Users/jacktfranklin/src/puppeteer
> tsc --version && tsc -p . && cp src/protocol.d.ts lib/ && cp src/externs.d.ts lib/

Version 3.8.3
Downloading Chromium r737027 - 118.4 Mb [====================] 100% 0.0s
ERROR: Failed to set up Chromium r737027! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
Puppeteer currently does not work on Node v14 due to an upstream bug. Please see #5719 for details.
```

The explicit message should save users a good amount of debugging time.
@jackfranklin
Copy link
Collaborator

I have opened #5732 which at least fixes the silent failures and provides a helpful message.

dr-js added a commit to dr-js/dr-js that referenced this issue Apr 24, 2020
notable change:
- temp-fix: ci: delay test 14.x, wait for: puppeteer/puppeteer#5719
- fix: sanity test for `nodejs@14`
- node: add TLS server session ticket rotation
- use `response.writableEnded` (need nodejs@>=12.9)
- package update
dr-js added a commit to dr-js/dr-js that referenced this issue Apr 24, 2020
notable change:
- temp-fix: ci: delay test 14.x, wait for: puppeteer/puppeteer#5719
- fix: sanity test for `nodejs@14`
- node: add TLS server session ticket rotation
- use `response.writableEnded` (need nodejs@>=12.9)
- package update
dr-js added a commit to dr-js/dr-js that referenced this issue Apr 25, 2020
notable change:
- temp-fix: ci: delay test 14.x, wait for: puppeteer/puppeteer#5719
- fix: ci: git CRLF config & longer test timeout
- fix: sanity test for `nodejs@14`
- node: add TLS server session ticket rotation
- use `response.writableEnded` (need nodejs@>=12.9)
- package update
jackfranklin added a commit that referenced this issue Apr 27, 2020
* chore: Useful error for Node v14 breakage

There is currently a bug with extract-zip and Node v14.0.0 that
causes extractZip to silently fail:
#5719

Rather than silenty fail if the user is on Node 14 we instead
detect that and throw an error directing the user to that bug. The
rejection message below is surfaced to the user in the command line.

The issue seems to be in streams never resolving so we wrap the call in
a timeout and give it 100ms to resolve before deciding on an error. If
the user is on Node < 14 we maintain the behaviour we had before this
patch.

Here's how this change impacts the output on Node 14 and Node 10:

Node 10:

```
npm run tsc && rm -r .local-* && node install

> puppeteer@3.0.1-post tsc /Users/jacktfranklin/src/puppeteer
> tsc --version && tsc -p . && cp src/protocol.d.ts lib/ && cp src/externs.d.ts lib/

Version 3.8.3
Downloading Chromium r737027 - 118.4 Mb [====================] 100% 0.0s
Chromium (737027) downloaded to /Users/jacktfranklin/src/puppeteer/.local-chromium/mac-737027
```

---

Node 14 without this patch:

```
npm run tsc && rm -r .local-* && node install

> puppeteer@3.0.1-post tsc /Users/jacktfranklin/src/puppeteer
> tsc --version && tsc -p . && cp src/protocol.d.ts lib/ && cp src/externs.d.ts lib/

Version 3.8.3
Downloading Chromium r737027 - 118.4 Mb [====================] 100% 0.0s
```

Note that whilst it doesn't error, it doesn't complete the install. We
don't get the success message that we saw above in the Node 10 install.

---

Node 14 with this patch:

```npm run tsc && rm -r .local-* && node install

> puppeteer@3.0.1-post tsc /Users/jacktfranklin/src/puppeteer
> tsc --version && tsc -p . && cp src/protocol.d.ts lib/ && cp src/externs.d.ts lib/

Version 3.8.3
Downloading Chromium r737027 - 118.4 Mb [====================] 100% 0.0s
ERROR: Failed to set up Chromium r737027! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
Puppeteer currently does not work on Node v14 due to an upstream bug. Please see #5719 for details.
```

The explicit message should save users a good amount of debugging time.
sverweij added a commit to mscgenjs/mscgenjs-cli that referenced this issue Apr 27, 2020
also ⬆️ @types/chai, @types/lodash, @types/mocha, @types/node, @types/puppeteer, @types/semver, ajv, commander, dependency-cruiser, mocha, mscgenjs, mscgenjs-inpage, nyc, prettier, puppeteer, semver, ts-node, tslint, typescript, upem

also keep puppeteer on 2.1.1 as 3.x does install incorrectly when npm i'd in node 14. Also see puppeteer/puppeteer#5719
sverweij added a commit to mscgenjs/mscgenjs-cli that referenced this issue Apr 27, 2020
also ⬆️ @types/chai, @types/lodash, @types/mocha, @types/node, @types/puppeteer, @types/semver, ajv, commander, dependency-cruiser, mocha, mscgenjs, mscgenjs-inpage, nyc, prettier, puppeteer, semver, ts-node, tslint, typescript, upem

also keep puppeteer on 2.1.1 as 3.x does install incorrectly when npm i'd in node 14. Also see puppeteer/puppeteer#5719
@RollsBean
Copy link

Same issue troubled me, puppeteer v3.0.1 doesn't support Node v8.14, i reduced the puppeteer version and it worked, but i don't what is the node minimum version of each puppeteer version.

@leecade
Copy link

leecade commented Apr 29, 2020

same here

@AviVahl
Copy link
Contributor

AviVahl commented Apr 30, 2020

Fixed by Node 14.1.0. Verified on Linux/Mac/Windows.

@AviVahl
Copy link
Contributor

AviVahl commented Apr 30, 2020

Alright, it failed once in one of our projects because of the (node14-specific) timeout that was added to the extraction process. 10s is too low for our CI.

Workaround bites back. Any chance for it to be removed, now that Node is fixed?

FYI @jackfranklin

@DRoet
Copy link
Author

DRoet commented May 1, 2020

Can confirm it is working again on 14.1.0, but the new node14 timeout indeed fails sometimes on slower CI runs.

@nstepien
Copy link

nstepien commented May 5, 2020

It's also intermittently failing for us because of the short timeout.

@AviVahl
Copy link
Contributor

AviVahl commented May 6, 2020

@mathiasbynens saw you've just released a patch version which still has this issue. any chance for another one with the node14-specific-timeout removed? :) this is what blocks me from adding Node 14 tests to several projects.

jackfranklin pushed a commit that referenced this issue May 7, 2020
closes #5719

Original stream.pipeline issue has been fixed in Node 14.1.0 and above.

Meanwhile, the workaround itself caused timout failures in many CI Node 14 runs, as reported in #5719.

Removed it, as it's no longer needed, and actually blocks consumers from adding CI testing on Node 14.
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 a pull request may close this issue.

9 participants