Skip to content

Consider unifying cache verification for modern Yarn #3137

Description

@jong-kyung

Vite+ no longer depends on Corepack, but it still supports integrity pins that Corepack writes to the packageManager field.

For Yarn 2 and later, these pins cover bin/yarn.js, not the npm tarball. Changing the hash target would break existing valid pins, as previously reported in #2209 and fixed in #2227.

Could we use a common cache verification policy for all package managers? When the verification record is missing or differs from the requested pin, Vite+ would download, verify, and replace the installation instead of rehashing the cached Yarn CLI.

Modern Yarn would still verify the extracted bin/yarn.js to preserve existing pin compatibility. This would require network access in cases where local verification currently works.

Activity

  1. jong-kyung commented on Oct 20, 2026

    @jong-kyung
    CollaboratorAuthor
  2. fengmk2 commented on Oct 20, 2026

    @fengmk2
    Member

    Can you provide a better solution? 😄

  3. jong-kyung commented on Oct 20, 2026

    @jong-kyung
    CollaboratorAuthor

    4. Can you provide a better solution? 😄

    One option would be to verify modern Yarn against the npm tarball hash rather than the extracted CLI hash for both fresh installs and cache reuse, making it consistent with other package managers. This would be a breaking change for existing Corepack-generated Yarn pins. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Fields

    Priority

    None yet

    Start date

    None yet

    Target date

    None yet

    Effort

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions