berry icon indicating copy to clipboard operation
berry copied to clipboard

[Bug] Automerge confused by change of checksums between yarn versions

Open SimenB opened this issue 3 years ago • 5 comments

  • [ ] I'd be willing to implement a fix

Describe the bug

Going from [email protected] to installing from sources changes the checksums (and cacheKey). If later getting a merge conflict with the previous version yarn automatically resolves the conflicts, but ends up erroring during install with YN0018 (The remote archive doesn't match the expected checksum)

To Reproduce

https://github.com/SimenB/yarn-merge-error

What I've done is yarn init -2 && yarn set version berry. I then installed a couple of dependencies and did some lockfile shenanigans to get a bit older versions than latest installed. I then created a new branch (sources) and ran yarn set version from sources && yarn there, commiting the result. Then back on main I did rm yarn.lock && yarn to get a fresh lockfile and commit that. The moving back to sources I rebase on main getting conflicts in the lockfile. Finally, running yarn to automatically resolve the conflicts. This works, but ends up with YN0018 errors.

Screenshots

N/A

Environment if relevant (please complete the following information):

  • OS: macOS
  • Node version 14.15.3
  • Yarn version 2.4.1 and 2.4.0-git.20210308.hash-53e33b45

Additional context

N/A

SimenB avatar Mar 09 '21 07:03 SimenB

For me

@types/react@npm:17.0.0: The remote archive doesn't match the expected checksum was happening with

[email protected] Node 14.16.0 and on macOS too.

I removed all top level @types/react references in the yarn.lock and ran yarn again to get around it.

wegry avatar Mar 31 '21 13:03 wegry

I removed the package that was complaining, ran yarn, and then re-added the package with yarn add. This worked for some reason.

bbugh avatar Jul 19 '21 22:07 bbugh

I encountered the same issue. Have not found a workaround yet (the above does not work).

LaurensRietveld avatar Jul 05 '22 13:07 LaurensRietveld

@LaurensRietveld what version of yarn are you using? I think I may still be running into this in [email protected] around @storybook/[email protected].

For now, I have

# .yarnrc.yml
# @storybook/addon-storyshots is breaking for some reason...
checksumBehavior: ignore

wegry avatar Jul 05 '22 13:07 wegry

I'm using [email protected]. The package involved was the debug package

LaurensRietveld avatar Jul 05 '22 14:07 LaurensRietveld

Woah, almost double issue number 🎉

SimenB avatar Nov 11 '22 19:11 SimenB