-
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
Theia builds are weirdly broken with npm 5.3.0 + yarn 1.1.0 #4539
Comments
Tried the latest npm 5.4.2 + yarn 1.1.0 the same issue. |
Might be related, I upgraded to 1.1.0 this morning, and now, in the browser of my React project, I'm getting this error
I presume this is yarn somehow adding a different copy of a dependency with 1.1.0 that it's not doing in 1.0.2. It should be noted that the yarn version is the only thing I'm changing. |
npm 3.10.10 + yarn 1.1.0, same issue here |
This is most probably after #4478. I'd say look into your dependency definitions and peer dependency definitions to make sure you are using peerDependencies where you actually want to enforce the same instance of a dependency instead of dependencies or dev dependencies. If you are sure your configuration is correct, please post a minimal reproduction case here so others can verify and start working on a possible fix. That "others" can be you if you ever fancied working in a package manager code base :) |
After some digging I found out that the typescript peerDependency of tsutils is realised in its node_modules so with yarn 1.1.0 I get:
While with 1.0.2 I don't get this directory there. Seems to me this should not happen since typescript is a peerDependency and should not be realised in tsutils's node_modules right? |
I made a minimalist reproducer project here: https://github.com/hexa00/repro-tslint-yarn If anyone wants to take a look ? Thanks! |
I've run repro locally with Yarn 1.1.0 and I got same results. Furthermore Note duplicated |
Upgraded to yarn 1.1.0 yesterday and having exactly the same issue as @jktravis' |
We are facing the same issue using completely different packages as the ones listed: for us react-widgets is throwing this same error. Also, as a further info, if you just avoid yarn and use Thanks for looking into this. |
I can confirm that 1.0.1 and 1.0.2 are fine but 1.1.0 and 1.2.0 contains what @jktravis showed. |
@BYK Any chance you can look into this? It feels like fix for peer dependencies in 1.1.0 introduced another regression. Simple repro is in #4539 (comment) and my findings are in the next comment. Behavior in 1.2.0 is same as behavior described for 1.1.0. PS Duplicated peer dependencies are likely a root cause of the problem described in the original post. |
@devoto13 thanks for the follow-up. I was curious if 1.2.0 would fix this one but apparently not. I'll look into the comments and try to understand what is happening here. |
Alright, I did some investigation and there indeed seems to be a bug: Yarn prefers resolving peer dependencies from the closest level but it doesn't verify if they are under the same tree with the current implementation. This causes the current, weird resolution due to following:
A fix is on the way. |
…t trees **Summary** Fixes #4539. Yarn was resolving peer dependencies from the closest level where the peer dependency was requested but it was not checking if the peer dependency was in the same subtree. This was causing incorrect peer dependency resolutions and package duplication when an unrelated subtree has a depedency satisfying the required peer dependency at the same tree level. **Test plan** Manually verified. Autmated tests coming.
#4687) **Summary** Fixes #4539. Yarn was resolving peer dependencies from the closest level where the peer dependency was requested but it was not checking if the peer dependency was in the same subtree. This was causing incorrect peer dependency resolutions and package duplication when an unrelated subtree has a depedency satisfying the required peer dependency at the same tree level. **Test plan** Added new install integration test that fails without the fix.
yarnpkg#4687) **Summary** Fixes yarnpkg#4539. Yarn was resolving peer dependencies from the closest level where the peer dependency was requested but it was not checking if the peer dependency was in the same subtree. This was causing incorrect peer dependency resolutions and package duplication when an unrelated subtree has a depedency satisfying the required peer dependency at the same tree level. **Test plan** Added new install integration test that fails without the fix.
Theia builds are failing with weird errors from tslint with npm 5.3.0 + yarn 1.1.0: https://travis-ci.org/theia-ide/theia/jobs/279443045
With yarn 1.0.2 it is fine: https://travis-ci.org/theia-ide/theia/jobs/279458465
The text was updated successfully, but these errors were encountered: