[Bug?]: yarn constraints --fix
leads to malformed package.jsons
#5853
Labels
bug
Something isn't working
yarn constraints --fix
leads to malformed package.jsons
#5853
Self-service
Describe the bug
I just upgraded to yarn v4 from 3.6.1 and have been playing around with the new js-based constraints. I've written a couple of constraints in
yarn.config.cjs
and they seem to work well, but runningyarn constraints --fix
followed by a secondyarn constraints
in a monorepo reveals that the--fix
call mangled one or more package.jsons:git diff
shows there are multiple package.jsons that have this modification:To reproduce
(the link above to https://yarnpkg.com/advanced/sherlock does not resolve, fwiw)
EDIT: I originally had a more complicated set of constraints, but have reproduced the issue consistently even with one constraint below
My constraint looks as follows:
Environment
System: OS: Linux 6.2 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish) CPU: (32) x64 Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz Binaries: Node: 18.18.0 - /nail/tmp/xfs-f84e62f7/node Yarn: 4.0.0 - /nail/tmp/xfs-f84e62f7/yarn npm: 9.8.1 - /opt/nodejs/node-v18.18.0/bin/npm npmPackages: jest: ^29.1.2 => 29.1.2
Additional context
No response
The text was updated successfully, but these errors were encountered: