Skip to content

vp migrate on an existing Vite+ project migrates to the INSTALLED CLI version, downgrading vite/vitest instead of upgrading #2662

Description

@Skaidon

Summary

On a project that is already on Vite+, vp migrate aligns the whole toolchain to the version of the installed vp CLI rather than to the latest release. When the project's own dependencies are newer than that CLI's pins, migrate downgrades them and writes a catalog pinned to the old version — while reporting success.

vp migrate --help documents the opposite:

--full Existing Vite+ projects: also run the full setup (…). Without it, vp migrate only upgrades the toolchain version.

Environment

  • vite-plus installed: 0.2.9 (latest at the time: 0.3.1)
  • pnpm 11.1.2, Node 25.9.0, Windows 11
  • Vue 3 + Vitest project, browser mode via @vitest/browser-playwright

Before running migrate:

package version
vite ^8.2.2 (real vite, not yet aliased)
vitest 4.1.11
@vitest/browser ^4.1.11
@vitest/browser-playwright ^4.1.11
vite-plus ^0.2.9

Repro

  1. In a project on vite-plus@0.2.9 with the versions above, run:
pnpm exec vp migrate --no-interactive --no-hooks --no-agent --no-editor
  1. Observed output:
Formatting code...

Code formatted
◇ Updated . to Vite+ 0.2.9
• Node 25.9.0  pnpm 11.1.2
• Dependencies:
    vite                        8.2.2  → 8.2.1
    vitest                      4.1.11 → 4.1.10
    @vitest/browser             4.1.11 → 4.1.10
    @vitest/browser-playwright  4.1.11 → 4.1.10
✓ Dependencies installed in 11s
• 166 files had imports rewritten
• Package manager settings configured
  1. Resulting pnpm-workspace.yaml:
catalog:
  vite: npm:@voidzero-dev/vite-plus-core@0.2.9
  vitest: 4.1.10
  vite-plus: 0.2.9
  "@vitest/browser-playwright": 4.1.10

Expected

One of:

  • migrate to the latest vite-plus, or
  • keep migrating to the installed CLI version but refuse or warn loudly when that pins dependencies backwards — e.g. installed vp is 0.2.9, latest is 0.3.1; this will downgrade vite 8.2.2 → 8.2.1 and vitest 4.1.11 → 4.1.10. Run vp upgrade first, or pass --force.

Actual

The toolchain is pinned to 0.2.9 and four packages are downgraded. The run reports and ◇ Updated . to Vite+ 0.2.9, and is otherwise indistinguishable from a correct migration — same "166 files had imports rewritten", same "Package manager settings configured". The only signal is the small dependency table, which shows the version moves without labelling them as downgrades or mentioning that a newer vite-plus exists.

This is easy to walk into, because the way you discover you need to migrate is this error from a newer CLI:

error: Failed to resolve vite command: GenericFailure, Expected @voidzero-dev/vite-plus-core@0.3.1,
but found vite@8.2.2 at …/node_modules/vite/package.json. Run `vp migrate` to align the Vite alias,
then run `vp install`.

…so "run vp migrate to get onto 0.3.x" is the natural reading, and it silently does the reverse if the installed CLI is still the old one.

Workaround

Install the target CLI first, then migrate:

pnpm add -D vite-plus@^0.3.1
pnpm exec vp migrate --no-interactive

That produced the correct result — ◇ Updated . to Vite+ 0.3.1, catalog at npm:@voidzero-dev/vite-plus-core@0.3.1, vitest left at 4.1.11, no downgrades.

Related

Activity

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

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions