-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
yarn seems to be erroneously logging incorrect peer dependency warnings #4433
Comments
incorrect peer dependency warnings
even though the dependencies install correctly as one would expect given the package.json files
@bjankord thanks for tidying up those issues. These all look stemming from the same root cause to me so may be we should consolidate all of them into a single issue (may be this one?). What do you think? |
+1, sounds good to me. |
It seems to be caused by changes in #3803. Easy repro is to clone Yarn repo and
From the linked PR it looks like one should satisfy every peer dependency in the root
Is "one should satisfy every peer dependency in the root Maybe I don't understand all the implications, but I don't see any sense in the warning for the given dependency tree. Since cc @kaylieEB |
Definitely seems like the same issue as #4342. The PR (#3803) was to fix incorrect semver modules from being copied in nested modules structure, but we can revert it for now since we have selective resolutions to force a nested module to have a particular version. This would restore the old bug (#3710) by swallowing the warning but at least there's a workaround. @BYK I can't work on the real fix atm, maybe next week or so -- what do you think? fyi, I think #2387 is a separate issue. |
**Summary** Fixes #4446, fixes #4433. Follow up to #3893. The fix in #3893 was too aggressive, allowing only top-level dependencies to be used in peer dependency resolution which was incorrect. This patch allows resolving peer dependencies from the same or higher levels in the dependency tree. **Test plan** Additional unit and integration tests.
…4478) **Summary** Fixes #4446, fixes #4433, fixes #2688, fixes #2387. Follow up to #3803. The fix in #3893 was too aggressive, allowing only top-level dependencies to be used in peer dependency resolution which was incorrect. This patch allows resolving peer dependencies from the same or higher levels in the dependency tree. **Test plan** Additional unit and integration tests.
Has this been released yet? |
@elsurudo yup: 1.1.0 |
Thanks for the quick fix on this! |
…arnpkg#4478) **Summary** Fixes yarnpkg#4446, fixes yarnpkg#4433, fixes yarnpkg#2688, fixes yarnpkg#2387. Follow up to yarnpkg#3803. The fix in yarnpkg#3893 was too aggressive, allowing only top-level dependencies to be used in peer dependency resolution which was incorrect. This patch allows resolving peer dependencies from the same or higher levels in the dependency tree. **Test plan** Additional unit and integration tests.
It looks like this mostly fixed the issue for me. But I'm running into a case with beta version numbers that still logs peer dependency errors in workspace mode:
This only happens when a beta package is not listed in every work space package. For example, I use If I add |
Still getting warnings with yarn v 1.3.2
package installed
|
I'm still seeing something similar:
It seems to happen for peer deps that are required by workspaces, even though they are eventually deps in other workspaces: // workspaces/w1/package.json
{
"name": "w1",
"dependencies": {
"package-a": "^1.0.0",
"package-b": "^2.0.0"
}
}
// workspaces/w2/package.json
{
"name": "w2",
"peerDependencies": {
"package-a": "^1.0.0"
}
}
// root package.json
{
"name": "",
"dependencies": {}
} Running |
Getting same behaviour for namespaced packages... |
I still see the same with yarn 1.15.2 for Can we reopen this? |
Just experienced this. The warning I get:
Though Yarn version is 1.16.0 on macOS 10.14.4, using nodejs v10.15.3. |
Do you want to request a feature or report a bug?
Bug Report
What is the current behavior?
tl;dr yarn seems to be erroneously logging
incorrect peer dependency warnings
even though the dependencies install correctly as one would expect given the package.json files.We have a monorepo structure with lerna using independent versioning and yarn workspaces. When we run
yarn or yarn install
we are seeing multipleincorrect peer dependency warnings
.We have multiple npm packages in the monorepo and some of the packages have 1 way dependencies amongst themselves.
For example:
package-B
has a dependency / peerDependency onpackage-A ^1.0.0
package-C
has a dependency / peerDependency onpackage-A ^1.0.0
package-B
andpackage-C
have dependencies and peerDependencies which look like this:Even though there are multiple
incorrect peer dependency warnings
, the dependencies are installed as expected in the root node_modules directory which satisfies the specified dependencies and peerDependencies for each package.If the current behavior is a bug, please provide the steps to reproduce.
I'm trying to create a reduced test-case, but you can reproduce the warnings in our project repo, terra-core, in this branch: https://github.com/cerner/terra-core/tree/update-lerna
Steps to repro:
git clone https://github.com/cerner/terra-core.git
update-lerna
branch:git fetch origin
git checkout --track origin/update-lerna
yarn
Once it gets to the
Linking dependencies...
step, it will start to log multiple warnings around incorrect peer dependencies.Here is the output related to the warnings:
Output
What is the expected behavior?
Running through the steps to reproduce the bug does not trigger erroneous
incorrect peer dependency warnings
.Please mention your node.js, yarn and operating system version.
Additional Notes
I spent some time looking through the Yarn codebase to see if I could better understand this issue. I ended up here but wasn't able to spot anything around what causes this issue.
Related issues
#4342
#4064
#2387
This may have some relation with this issue as well: #4432
The text was updated successfully, but these errors were encountered: