[Bug?]: `yarn upgrade-interactive` drops the prerelease suffix from suggested versions

Open Beginner friendly
#7,334 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@lucas-gomes-santana is already working on this.

Since Nov 18, 2026.

  • #7338 by @lucas-gomes-santana — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
node.js, typescript
Domain
cli, devtools

Research direction

Start with the upgrade-interactive implementation and the code that formats suggested dependency versions; trace how prerelease versions are converted to display labels. Reproduce with the provided @mui/x-chat example, then check the relevant tests for interactive upgrade suggestions. Done means the label shows 9.0.0-alpha.22 while selecting it still installs that prerelease.

Written by the indexing model from the issue text.

Description

bug
Self-service
  • I'd be willing to implement a fix
Describe the bug

yarn upgrade-interactive leaves out the prerelease part of a suggested version.

For example, a dependency on 9.0.0-alpha.20 gets the suggestion 9.0.0, although the version it would install is 9.0.0-alpha.22. Version 9.0.0 doesn't exist, so the suggestion looks like a stable release that isn't there:

image

(There's no version 9.0.0 at the moment, see https://github.com/mui/mui-x/releases)

The bug affects only the label - selecting the suggestion installs the latest prerelease version.

To reproduce
  1. Create a project with this package.json:
{
  "dependencies": {
    "@mui/x-chat": "9.0.0-alpha.20"
  }
}
  1. Run yarn install, then yarn upgrade-interactive.
  2. The suggestion for @mui/x-chat reads 9.0.0. The expected label is 9.0.0-alpha.22.

(Any dependency whose suggestion differs from the current version only in the prerelease part shows the
same problem.)

Environment
System:
    OS: Linux 7.0 Ubuntu 26.04.1 LTS 26.04.1 LTS (Resolute Raccoon)
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-13700H
  Binaries:
    Node: 26.13.1 - /tmp/xfs-d52a8761/node
    Yarn: 4.18.1 - /tmp/xfs-d52a8761/yarn
    npm: 11.20.0 - /run/user/1000/fnm_multishells/941582_1794813157453/bin/npm
    bun: 1.3.14 - /home/igor/.bun/bin/bun
Additional context

No response

Dominant language
TypeScript
Stars
8.1k
Forks
1.4k
Avg merge
2d 1h
Merged PRs (30d)
4

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from yarnpkg/berry

All issues in yarnpkg/berry

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.