pnpm version: 7.29.1
Code to reproduce the issue:
The issue is reproducible in this branch of a project using pnpm, with dedupe-peer-dependents enabled in its local .npmrc.
pnpm i
cd test-app
pnpm why ember-source
Expected behavior:
The test-app workspace has a direct dependency on ember-source@4.4.4. Many other dependencies have a peer dependency on ember-source. I was expecting to see all those peer dependencies to resolve to the same ember-source@4.4.4.
Actual behavior:
This is the output of why:
test-app@0.0.0 /Users/sihmig/Projects/oss/ember-headless-form/test-app
devDependencies:
@ember/test-helpers 2.9.3
├─┬ @embroider/util 1.10.0
│ └── ember-source 4.10.0 peer
└── ember-source 4.10.0 peer
@glint/environment-ember-loose 1.0.0-beta.3
└─┬ ember-modifier 4.1.0 peer
└── ember-source 4.10.0 peer
@glint/environment-ember-template-imports 1.0.0-beta.3
└─┬ @glint/environment-ember-loose 1.0.0-beta.3 peer
└─┬ ember-modifier 4.1.0 peer
└── ember-source 4.10.0 peer
@types/ember-qunit 6.1.1
└─┬ ember-qunit 6.2.0
├─┬ @ember/test-helpers 2.9.3 peer
│ ├─┬ @embroider/util 1.10.0
│ │ └── ember-source 4.10.0 peer
│ └── ember-source 4.10.0 peer
└── ember-source 4.4.4 peer
@types/ember-resolver 9.0.0
└─┬ ember-resolver 10.0.0
└── ember-source 4.4.4 peer
ember-a11y-testing 5.2.0
└─┬ @ember/test-helpers 2.9.3 peer
├─┬ @embroider/util 1.10.0
│ └── ember-source 4.10.0 peer
└── ember-source 4.10.0 peer
ember-headless-form 1.0.0-beta.0
├─┬ @embroider/util 1.10.0
│ └── ember-source 4.4.4 peer
├─┬ ember-modifier 4.1.0
│ └── ember-source 4.4.4 peer
└── ember-source 4.4.4 peer
ember-headless-form-changeset 1.0.0-beta.0
├─┬ ember-headless-form 1.0.0-beta.0 peer
│ ├─┬ @embroider/util 1.10.0
│ │ └── ember-source 4.4.4 peer
│ ├─┬ ember-modifier 4.1.0
│ │ └── ember-source 4.4.4 peer
│ └── ember-source 4.4.4 peer
└── ember-source 4.4.4 peer
ember-headless-form-yup 1.0.0-beta.0
├─┬ ember-functions-as-helper-polyfill 2.1.1
│ └── ember-source 4.4.4 peer
├─┬ ember-headless-form 1.0.0-beta.0 peer
│ ├─┬ @embroider/util 1.10.0
│ │ └── ember-source 4.4.4 peer
│ ├─┬ ember-modifier 4.1.0
│ │ └── ember-source 4.4.4 peer
│ └── ember-source 4.4.4 peer
└── ember-source 4.4.4 peer
ember-qunit 6.2.0
├─┬ @ember/test-helpers 2.9.3 peer
│ ├─┬ @embroider/util 1.10.0
│ │ └── ember-source 4.10.0 peer
│ └── ember-source 4.10.0 peer
└── ember-source 4.4.4 peer
ember-resolver 10.0.0
└── ember-source 4.4.4 peer
ember-sinon-qunit 7.0.0
└── ember-source 4.4.4 peer
ember-source 4.4.4
You see that the direct dependency (last line) is at 4.4.4, and most other dependencies also resolve to 4.4.4 as their peer dependency. But at the very beginning is where it gets things wrong AFAICT: @ember/test-helpers, which has a peer on "ember-source": ">=3.8.0" gets to see 4.10.0 (which we have in the repo, but for different workspaces!).
Interestingly, when I nuke node_modules and the lockfile, and also remove the dedupe-peer-dependents setting and do a fresh install, then the problem is gone, all just see ember-source@4.4.4 as expected! So the problem that dedupe-peer-dependents tries to fix seems to get caused by it in this case!? 🤯
Additional information:
node -v prints: 18.12.1
- Windows, macOS, or Linux?: mac
pnpm version: 7.29.1
Code to reproduce the issue:
The issue is reproducible in this branch of a project using pnpm, with
dedupe-peer-dependentsenabled in its local.npmrc.pnpm i cd test-app pnpm why ember-sourceExpected behavior:
The test-app workspace has a direct dependency on
ember-source@4.4.4. Many other dependencies have a peer dependency onember-source. I was expecting to see all those peer dependencies to resolve to the sameember-source@4.4.4.Actual behavior:
This is the output of
why:You see that the direct dependency (last line) is at
4.4.4, and most other dependencies also resolve to4.4.4as their peer dependency. But at the very beginning is where it gets things wrong AFAICT:@ember/test-helpers, which has a peer on"ember-source": ">=3.8.0"gets to see4.10.0(which we have in the repo, but for different workspaces!).Interestingly, when I nuke node_modules and the lockfile, and also remove the
dedupe-peer-dependentssetting and do a fresh install, then the problem is gone, all just seeember-source@4.4.4as expected! So the problem thatdedupe-peer-dependentstries to fix seems to get caused by it in this case!? 🤯Additional information:
node -vprints: 18.12.1