-
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
Don't warn about unmet/missing package constraints on install #4064
Comments
@yarnpkg/core would love to hear opinions on this. |
I suspect a fair amount of our users never use
Which warnings exactly are you refering to? The ones you're refering to basically mean "btw, your application might possibly crash, since the versions don't match", so I'm not sure they would qualify as noise. That being said, I agree we report some things as warnings when the things we warn about can't have any visible effect. The license warning comes to mind, but there might be more. |
Ah, great point. Glad you mentioned that. That means we should handle this case too: "when running install but only if package.json is updated (doesn't match yarn.lock)?"
Even
Yeah there are more and I think we should reduce our usage of warnings and replace them with |
Looks correct.
Even if it's not directly actionnable I'd argue it's still pretty important. The bug might not be in our package, but it still exists. At the very least, a valid action is to forward this error to the package maintainer (in My current train of thought is:
I would be in favor of whitelisting the warnings that need to be silenced. For example the following content in a
What do you think? Two policies would be applicable on this file (possibly toggled on-off via a yarnrc flag): strict or not. In strict mode, install would have to yield those warning, no more no less, or the install would abort. In non-strict mode, any extra warning would be printed, and any missing warning would also be reported, but the install would complete. As an extra, maybe we should make it more obvious who the point of contact is - in |
This may not be a bug and even then, if it is not actionable, there's no point in showing it (except, may be in debug mode).
This is an interesting thought but it would quickly turn into spam? Also what about private packages etc.?
I kind of agree but you cannot know if this would have a "visible" effect or not. I'd go with "anything that is not actionable and not breaking builds should remain silent (info/debug)".
See above.
This is interesting. We may wanna start assigning ID's/error-codes to warnings like JSHint did and also have mechanisms to silence these but I have a feeling that it may become too hairy and out of scope for yarn. Also it may result in hiding important warnings if this is configured incorrectly.
Interesting, since I've been thinking about something similar but separately from this. I think we need a command-line flag (that can also be added to
+1 |
As far as I see it, it is currently impossible to run yarn without a bunch of unmet peer dependencies. |
An extra thing I think that we could/should do (in the process of improving the publish process) would be to have an actual validation. It shouldn't be possible to push a package that would unexpectedly trigger such warnings. |
+1 for reducing the noise. Maybe we can introduce a summary version like
|
since I haven't seen it mentioned yet I think it's also worth mentioning that a no This would be different from the
|
Our thoughts:
As for the message:
I don't know if |
It takes us hours to fix some of the peer dependency warnings in a big monorepo. This is specially annoying when you are using yarn workspaces. We have lots of tests for our projects and all tests are passing so definitely something is wrong about these warnings or how people develop libraries! |
I'm surprised this issue hasn't gotten more attention over the years:
the |
I've taken a closer look at this issue.
Internally, we're mostly using yarn as a checked in .js 'binary' for handling offline CI installs. Because there probably won't be any major changes to yarn v1.22, we simply removed the respective warning output locally: Lines 661 to 666 in 98d51d8
|
I seem to still be experiencing the same, our CI/CD logs are bloated with irrelevant warnings, what we did is to just filter them out with pipes and grep: {
"yarn": "yarn install 2> >(grep -v warning 1>&2)"
} But this doesn't solve the DX issue, when I run Shouldn't this be handled with .yarnrc.yml? It's supposedly covered here actually, but it's not working for me, at least not in yarn workspaces (monorepo). It somewhat works with this: logFilters:
- level: discard
- pattern: "*unmet peer dependency*" But, when adding new dependencies the messages will appear again |
This may sound a bit controversial: we should not display warnings when there are unmet package dependencies when running
yarn install
.Reasoning
The users of
yarn install
are usually the consumers of the package and displaying them warnings about certain package version issues is just noise, they are not actionable. These are only actionable when you are adding or upgrading packages.Proposal
Reduce the warnings to
info
ordebug
when runningyarn install
and make them warnings (or errors?) when runningyarn add
oryarn update
The text was updated successfully, but these errors were encountered: