Skip to content
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

Yarn upgrade --scope will throw when a workspace child deps is also in the upgrade list #7797

Open
JLHwung opened this issue Jan 4, 2020 · 0 comments

Comments

@JLHwung
Copy link
Sponsor

JLHwung commented Jan 4, 2020

Do you want to request a feature or report a bug?

bug.

What is the current behavior?
Yarn 1.19+ throws when upgrading workspace dependencies, the issue was introduced in #7289.

If the current behavior is a bug, please provide the steps to reproduce.

git clone --depth=1 https://github.com/vuejs/vue-cli
cd vue-cli

# Checkout to a specific commit so that babel always needs to be updated
git checkout 80b93951b1710733a66765cbd535b12b7bb59279

yarn install
printf 'a\n' | yarn upgrade-interactive --scope @babel --latest

It throws the following exception

Invariant Violation: expected workspace package to exist for "@babel/core"
    at invariant (/opt/yarn-v1.21.1/lib/cli.js:2314:15)
    at _loop2 (/opt/yarn-v1.21.1/lib/cli.js:94898:9)
    at PackageHoister.init (/opt/yarn-v1.21.1/lib/cli.js:94957:19)
    at PackageLinker.getFlatHoistedTree (/opt/yarn-v1.21.1/lib/cli.js:48743:20)
    at PackageLinker.<anonymous> (/opt/yarn-v1.21.1/lib/cli.js:48754:27)
    at Generator.next (<anonymous>)
    at step (/opt/yarn-v1.21.1/lib/cli.js:310:30)
    at /opt/yarn-v1.21.1/lib/cli.js:328:14
    at new Promise (<anonymous>)
    at new F (/opt/yarn-v1.21.1/lib/cli.js:5301:28)

This issue can be reproduced at Babel e2e-vuejs test: https://app.circleci.com/jobs/github/babel/babel/14500

What is the expected behavior?
It should upgrade all @babel/* dependencies to the latest versions.

** Additional Information **
Workaround: upgrade @babel/core before updating other @babel/* dependencies

yarn add --dev -W @babel/core
printf 'a\n' | yarn upgrade-interactive --scope @babel --latest

Please mention your node.js, yarn and operating system version.
Yarn 1.21.1
macOS 10.15.2
Node 13.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant