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

[Bug?]: Updating Yarn to v4 should remove non-bundled official Yarn plugins on first install #4952

Closed
1 task
wojtekmaj opened this issue Oct 11, 2022 · 5 comments · Fixed by #5446
Closed
1 task
Labels
bug Something isn't working upholded Real issues without formal reproduction
Milestone

Comments

@wojtekmaj
Copy link
Contributor

Self-service

  • I'd be willing to implement a fix

Describe the bug

Bumping Yarn from v3 to v4-rc and installing repo did update yarn.lock, but did not remove manually added official Yarn plugins that are now bundled in the main binary instead.

To reproduce

Environment

System:
    OS: macOS 13.0
    CPU: (8) arm64 Apple M1 Pro
  Binaries:
    Node: 16.16.0 - /private/var/folders/7r/rpcp4wz97jngh5x0nk88p5br0000gp/T/xfs-8193f93d/node
    Yarn: 4.0.0-rc.22 - /private/var/folders/7r/rpcp4wz97jngh5x0nk88p5br0000gp/T/xfs-8193f93d/yarn
    npm: 8.11.0 - /opt/homebrew/bin/npm
  npmPackages:
    jest: ^29.0.0 => 29.0.1

Additional context

No response

@wojtekmaj wojtekmaj added the bug Something isn't working label Oct 11, 2022
@jj811208

This comment was marked as off-topic.

@jj811208
Copy link
Contributor

I recently upgraded my yarn 3 projects to yarn 4 and ran into problems

I realized that I had misunderstood this issue, please forgive me for hiding my original comment 🥺.


Reproduction Steps:

image

A simple fix is

  1. run rm -rf .yarn/plugins/@yarnpkg
  2. delete the official plugins from the plugins field of .yarnrc.yml

maybe this should be documented in the migration tutorial from yarn3 to yarn4 🤔.

@wojtekmaj
Copy link
Contributor Author

If Yarn can detect and remove unwanted node_modules in PnP mode, then surely it can remove unwanted plugins of its own as well.

@yarnbot

This comment was marked as outdated.

@yarnbot yarnbot added the stale Issues that didn't get attention label Nov 22, 2022
@merceyz merceyz added the upholded Real issues without formal reproduction label Nov 22, 2022
@yarnbot yarnbot removed the stale Issues that didn't get attention label Nov 22, 2022
@PowerKiKi
Copy link
Contributor

@merceyz, could you please add this issue to the 4.0.0 milestone, if you indeed plan to solve it for 4.0.0, so the community can have a better overview of the work left for 4.0 ?

@merceyz merceyz added this to the 4.0.0 milestone May 16, 2023
arcanis added a commit that referenced this issue May 24, 2023
**What's the problem this PR addresses?**

When using `yarn set version` with Yarn 4, the core plugins that were
previously externals now conflict with the builtin ones, causing
surprising errors.

Fixes #4952

**How did you fix it?**

Yarn will now ignore the specified list of plugins when booting. It'll
then automatically remove them during the next install.

**Checklist**
<!--- Don't worry if you miss something, chores are automatically
tested. -->
<!--- This checklist exists to help you remember doing the chores when
you submit a PR. -->
<!--- Put an `x` in all the boxes that apply. -->
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).

<!-- See
https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released
for more details. -->
<!-- Check with `yarn version check` and fix with `yarn version check
-i` -->
- [x] I have set the packages that need to be released for my changes to
be effective.

<!-- The "Testing chores" workflow validates that your PR follows our
guidelines. -->
<!-- If it doesn't pass, click on it to see details as to what your PR
might be missing. -->
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upholded Real issues without formal reproduction
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants