berry
berry copied to clipboard
[Bug]: Yarn doesn't de-dupe patches
Self-service
- [x] I'd be willing to implement a fix
Describe the bug
I have a patch on reselect and use that directly as well as redux toolkit and redux toolkit wants a version "^5.0.0" and the patch is on 5.0.1.
yarn does not dedupe that it should use the patched version.
To reproduce
yarn add reselect
yarn add @reduxjs/toolkit
yarn patch reselect
and reselect is present in the root and under @reduxjs/toolkit
Environment
yarn crashes running this command due to another bug.
Its windows 10.
Additional context
No response
Adding a explicit resolution also makes no difference. Editing the yarn.lock file manually and yarn just reverts the change - so looks like the only work-around is to not use yarn patch.
sorry - a explicit resolution does work - I was missing that the resolution needs to be on the root package.json and there were no warnings about using it on a sub-package json.
The work-around to use patch-package isn't available as it does not currently support yarn.
there were no warnings about using it on a sub-package json.
There is a warning when you run an install, you might have missed it.
@merceyz sorry you are right, I somehow missed it for months :(