GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Yarn command gates use the launcher version instead of the version selected by yarnPath · Issue #3327 · voidzero-dev/vite-plus

Yarn command gates use the launcher version instead of the version selected by yarnPath #3327

New issue
Copy link
New issue
Copy link
Closed
Bug
#3532
Closed
Yarn command gates use the launcher version instead of the version selected by yarnPath#3327
Bug
#3532
Copy link
Assignees
jong-kyung
Labels
bugSomething isn't working

Description

@jong-kyung
jong-kyung
opened on Nov 3, 2026
Issue body actions

Problem

Vite+ selects Yarn behavior from the version in packageManager, which is the launcher it downloads. However, the launcher hands the command to the release in yarnPath unless ignorePath or YARN_IGNORE_PATH disables that delegation. When the two versions differ, Vite+ makes its decision for a version that does not run the command.

The most serious result is a silent false success. With packageManager: "[email protected]" and yarnPath pointing to Yarn 3.8.7, vp unlink prints a warning and exits with code 0, but the portal: resolution stays in package.json. Running the same launcher directly removes it. This was found in the review of #3286.

Reproduction

These steps need the unlink gate from #3286.

  1. Set "packageManager": "[email protected]" in package.json.
  2. Copy bin/yarn.js from @yarnpkg/[email protected] to .yarn/releases/yarn-3.8.7.cjs.
  3. Create .yarnrc.yml with nodeLinker: node-modules and yarnPath: .yarn/releases/yarn-3.8.7.cjs.
  4. Run vp install.
  5. Create ../linked-lib/package.json with the name linked-lib, then run vp link ../linked-lib.
  6. Run vp unlink linked-lib.

Expected: Yarn 3 removes the linked-lib resolution from package.json.

Actual: Vite+ prints this warning and exits with code 0, and the resolution stays.

warn: yarn unlink requires Yarn Classic or yarn >= 3.0.0. Skipping.

Affected checks

Result of a mismatch Checks Launcher and effective version Source
Skips a supported command unlink, patch-commit --save (Yarn 3) 2.x and 3 or later #3286
Skips a supported command audit (Yarn 2.4) Below 2.4 and 2.4 or later #3286
Skips a supported command patch, patch-commit, rebuild, whoami Classic and Berry main
Skips a supported command list, licenses, team Berry and Classic main
Falls back to npm stage (Yarn 4.16) Below 4.16 and 4.16 or later main
Rejects a supported option not_supported(yarn ...) rules with version conditions Depends on the rule Mostly main
Builds arguments for the wrong Yarn family is_berry() branches Classic and Berry main
Sends a setting the effective Yarn rejects YARN_ENABLE_TIPS in resolve_for_manager 4.x and 2.x or 3.x main

This table comes from reading the code. Only the Yarn 2 launcher delegating to Yarn 3 has been reproduced end to end. The Classic and Berry rows, and whether the Classic launcher delegates in the same way, still need to be confirmed.

Possible direction

An earlier attempt in #3286 (eb4b2c713) ran yarn --version before every Yarn command. It is accurate because Yarn applies its own configuration rules, but it adds a process to every command.

A cheaper option is to resolve with the launcher version first and query the effective version only when Vite+ declines the request, which means a Noop, an InvalidArgument, or a FallbackCommand diagnostic. If the query reports a different version, Vite+ resolves again. Commands that run need no query because Yarn reports its own errors.

This option would not fix the is_berry() argument branches or YARN_ENABLE_TIPS, because those affect commands that do run. Reading the version from the yarnPath file name avoids a process, but the name can be arbitrary, and it would not account for parent or home configuration files or environment overrides.

Activity

  1. jong-kyung
    added the
    Bug
    issue type on Nov 3, 2026
  2. jong-kyung
    added
    - P2: has workaroundAffects specific usage and has a straightforward workaround (priority)
    on Nov 3, 2026
  3. jong-kyung
    self-assigned this
    on Nov 3, 2026
  4. jong-kyung
    added
    bugSomething isn't working
    and removed
    - P2: has workaroundAffects specific usage and has a straightforward workaround (priority)
    on Nov 16, 2026
  5. jong-kyung commented on Nov 20, 2026

    @jong-kyung
    jong-kyung
    on Nov 20, 2026
    CollaboratorAuthor
    More actions

    I think Vite+ should not support yarnPath. When it is active, vp would error and ask the user to declare the Yarn version only in packageManager. Like the Plug'n'Play conversion, vp migrate would write the version that yarnPath runs to packageManager and remove yarnPath. @fengmk2 What do you think?

    cc/ @liangmiQwQ

  6. fengmk2 commented on Nov 20, 2026

    @fengmk2
    fengmk2
    on Nov 20, 2026 – with ChatGPT Codex Connector
    Member
    More actions

    I think Vite+ should respect yarnPath. I’d expect vp unlink to behave the same as yarn unlink in the same project. In the reported case, Yarn 2.4.2 hands the command to Yarn 3.8.7, which supports unlink. vp should let that command run.

    I’d keep using packageManager to select the Yarn launcher. When vp needs the version to decide whether a command or option is supported, it should use the version that launcher reports for the project. That lets Yarn apply its own rules for yarnPath, ignorePath, and YARN_IGNORE_PATH. Yarn’s implementation

    I’d also preserve yarnPath during vp migrate. A project can point it at a custom script. Yarn’s own repository does this to run its CLI from source. Replacing that path with a version in packageManager would change what the project runs. Yarn’s configuration · The script it runs

    Reacted by JongKyung Lee
  7. liangmiQwQ commented on Nov 20, 2026

    @liangmiQwQ
    liangmiQwQ
    on Nov 20, 2026
    Collaborator
    More actions

    I also supported that Vite+ should respect yarnPath. Yarn's version resolution logic is quite complicated, and if we could reliably identify and reject all these cases ourselves, we might as well just invoke yarn --version directly for the best possible compatibility.

    Reacted by JongKyung Lee
  8. fengmk2
    closed this as completedin #3532on Nov 23, 2026
  9. jong-kyung
    added a commit that references this issue on Nov 23, 2026

    fix(pm): gate Yarn commands on the version yarnPath selects (voidzero…

    This issue will close once commit 13c3d4b is merged into the 'main' branch.
    13c3d4b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @jong-kyung
    jong-kyung

Labels

bugSomething isn't working

Type

Bug

Fields

Priority

None yet

Effort

None yet

Target date

None yet

Start date

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.