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

Missing puppeteer-extra peer dependency #645

Closed
rtritto opened this issue Jun 2, 2022 · 6 comments
Closed

Missing puppeteer-extra peer dependency #645

rtritto opened this issue Jun 2, 2022 · 6 comments
Labels
issue: bug report A bug has been reported needs triage

Comments

@rtritto
Copy link

rtritto commented Jun 2, 2022

Transitive puppeteer-extra peer dependency must be included in each dependency:

  • puppeteer-extra-plugin-anonymize-ua
  • puppeteer-extra-plugin-block-resources
  • puppeteer-extra-plugin-click-and-wait
  • puppeteer-extra-plugin-devtools
  • puppeteer-extra-plugin-flash
  • puppeteer-extra-plugin-font-size
  • puppeteer-extra-plugin-repl
  • puppeteer-extra-plugin-stealth
  • puppeteer-extra-plugin-user-data-dir
  • puppeteer-extra-plugin-user-preferences

Changes

package.json

"peerDependencies": {
+  "puppeteer-extra": "*",
  ...
}
@rtritto rtritto added issue: bug report A bug has been reported needs triage labels Jun 2, 2022
@berstend
Copy link
Owner

Is this a hypothetical issue or a real-life one? npm changed their behavior around peer dependencies a while back, if I recall correctly

@rtritto
Copy link
Author

rtritto commented Jun 20, 2022

Steps to reproduce:

  1. yarn init -y
  2. yarn set version canary
  3. yarn add puppeteer puppeteer-extra puppeteer-extra-plugin-stealth

Output:

➤ YN0000: ┌ Resolution step
➤ YN0002: │ puppeteer-extra-plugin-stealth@npm:2.10.0 doesn't provide puppeteer-extra (p716a8), requested by puppeteer-extra-plugin
➤ YN0002: │ puppeteer-extra-plugin-user-data-dir@npm:2.3.1 doesn't provide puppeteer-extra (pbf180), requested by puppeteer-extra-plugin
➤ YN0002: │ puppeteer-extra-plugin-user-preferences@npm:2.3.1 doesn't provide puppeteer-extra (p3e49e), requested by puppeteer-extra-plugin
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed

Edit:
Source

@berstend
Copy link
Owner

berstend commented Jul 4, 2022

Given we now introduced playwright-extra (#664) which is able to load in those plugins we probably want to do the exact opposite and remove all peer dependencies 😄

Therefore closing this for now

@berstend berstend closed this as completed Jul 4, 2022
@rtritto
Copy link
Author

rtritto commented Jul 4, 2022

@berstend I don't know if you should consider to use optional peer dependency:

"peerDependencies": {
  "puppeteer-extra": "*",
},
"peerDependenciesMeta": {
  "puppeteer-extra": {
    "optional": true
  }
}

@berstend
Copy link
Owner

berstend commented Jul 4, 2022

The whole situation with peer dependencies is messy :-/

npm/cli#1247 (comment)

I wonder what the best behavior from our perspective would be, warning but not auto-installing?

@rtritto
Copy link
Author

rtritto commented Jul 4, 2022

With optional = true, peer dependencies will not be installed. Source: npm/rfcs#221 (comment)

Maybe, we can ask some help to arcanis and merceyz from yarn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug report A bug has been reported needs triage
Projects
None yet
Development

No branches or pull requests

2 participants