yarnpkg / yarnpkg/berry

[Bug?]: `explain peer-requirements` flags `peerDependencies` met by parent itself as missing

Open
#3,383 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug upholded
Dominant language
TypeScript
Stars
8.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Self-service
  • I'd be willing to implement a fix
Describe the bug

yarn explain peer-requirements complains about peerDependencies not being met when the parent is that dependency.

Related to https://github.com/yarnpkg/berry/issues/3382

To reproduce

Clone https://github.com/yarnpkg/berry/tree/b4b08736cb3a5612d765fe93b9624db374aeedf5 and run

$ yarn explain peer-requirements | grep webpack
[...]
p1a224 → webpack@npm:5.38.1 [e04a2] doesn't provide webpack to terser-webpack-plugin

$ yarn explain peer-requirements p1a224 
➤ YN0000: webpack@npm:5.38.1 [e04a2] doesn't provide webpack, breaking the following requirements:

➤ YN0000: terser-webpack-plugin@npm:5.1.3 [5eeea] → ^5.1.0 ✘
Environment
System:
  OS: Windows 10 10.0.19042
  CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor
Binaries:
  Node: 16.8.0 - ~\AppData\Local\Temp\xfs-eac3ab51\node.CMD        
  Yarn: 3.1.0-rc.2.dev - ~\AppData\Local\Temp\xfs-eac3ab51\yarn.CMD
  npm: 7.21.1 - C:\nodejs\npm.CMD
Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Clone the referenced Yarn Berry commit and reproduce the report with yarn explain peer-requirements | grep webpack and yarn explain peer-requirements p1a224. Trace how peer requirements are evaluated and reported when the parent is the dependency itself. Done means this self-provided webpack requirement is no longer reported as missing, while the command still reports genuine unmet requirements.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.