Skip to content

fix: drop vite 8.beta support#9862

Merged
sheremet-va merged 1 commit intovitest-dev:mainfrom
AriPerkkio:fix/yarn-1-compat
Mar 16, 2026
Merged

fix: drop vite 8.beta support#9862
sheremet-va merged 1 commit intovitest-dev:mainfrom
AriPerkkio:fix/yarn-1-compat

Conversation

@AriPerkkio
Copy link
Member

Description

Resolves #9859

Vite 8.0.0 is now latest so let's drop the beta support as it was planned. Supporting Vite's beta version was always meant to be experimental, so no breaking changes here.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.
  • Please check Allow edits by maintainers to make review process faster. Note that this option is not available for repositories that are owned by Github organizations.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@sheremet-va
Copy link
Member

sheremet-va commented Mar 14, 2026

This looks good to me, but I am not so sure it addresses the issue in yarn. vitest/mocker for example had 7.0.0-0 up until the new 4.1 version: https://npmx.dev/package-code/@vitest/mocker/v/4.0.18/package.json which means yarn supports this syntax

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 15, 2026

@vitest/browser

npm i https://pkg.pr.new/@vitest/browser@9862

@vitest/browser-playwright

npm i https://pkg.pr.new/@vitest/browser-playwright@9862

@vitest/browser-preview

npm i https://pkg.pr.new/@vitest/browser-preview@9862

@vitest/browser-webdriverio

npm i https://pkg.pr.new/@vitest/browser-webdriverio@9862

@vitest/coverage-istanbul

npm i https://pkg.pr.new/@vitest/coverage-istanbul@9862

@vitest/coverage-v8

npm i https://pkg.pr.new/@vitest/coverage-v8@9862

@vitest/expect

npm i https://pkg.pr.new/@vitest/expect@9862

@vitest/mocker

npm i https://pkg.pr.new/@vitest/mocker@9862

@vitest/pretty-format

npm i https://pkg.pr.new/@vitest/pretty-format@9862

@vitest/runner

npm i https://pkg.pr.new/@vitest/runner@9862

@vitest/snapshot

npm i https://pkg.pr.new/@vitest/snapshot@9862

@vitest/spy

npm i https://pkg.pr.new/@vitest/spy@9862

@vitest/ui

npm i https://pkg.pr.new/@vitest/ui@9862

@vitest/utils

npm i https://pkg.pr.new/@vitest/utils@9862

vitest

npm i https://pkg.pr.new/vitest@9862

@vitest/web-worker

npm i https://pkg.pr.new/@vitest/web-worker@9862

@vitest/ws-client

npm i https://pkg.pr.new/@vitest/ws-client@9862

commit: 4fdfbc6

@AriPerkkio
Copy link
Member Author

vitest/mocker for example had 7.0.0-0 up until the new 4.1 version

But not as dependency. I don't think this is just about syntax, it's some combination of dependency + peerDependency + -0 syntax.

For example, this one works fine on yarn@1.22.22:

{
  "name": "yarn-1",
  "packageManager": "yarn@1.22.22",
  "dependencies": {
    "vite": "^6.0.0",
    "vitest": "3.2.0"
  }
}

vitest@3.2.0 has "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" in dependencies, but no peerDependencies at all.

@sheremet-va sheremet-va merged commit b78f538 into vitest-dev:main Mar 16, 2026
17 of 18 checks passed
@AriPerkkio AriPerkkio deleted the fix/yarn-1-compat branch March 16, 2026 08:28
@psmyrek
Copy link

psmyrek commented Mar 16, 2026

Hey guys, this PR does not solve the #9859 issue.

Example:

{
    "name": "foo",
    "version": "1.0.0",
    "dependencies": {
        "vite": "^7.0.0",
        "vitest": "https://pkg.pr.new/vitest@b78f538"
    }
}

Then yarn install still produces the same Invariant Violation: could not find a copy of vite to link error.

It seems that defining vite in dependencies and peerDependencies as ^6.0.0 || ^7.0.0 || ^8.0.0 causes Invariant Violation error. However, defining vite in dependencies and peerDependencies as ^7.0.0 || ^8.0.0 does not throw any error and installation in yarn v1.x goes without any problems.

@sheremet-va
Copy link
Member

sheremet-va commented Mar 16, 2026

However, defining vite in dependencies and peerDependencies as ^7.0.0 || ^8.0.0 does not throw any error and installation in yarn v1.x goes without any problems.

I think the second installation just always succeeds? The error sometimes appear for me, sometimes not. Maybe it caches something? This seems like an issue with Yarn 1 rather than with Vitest's package.json.

@psmyrek
Copy link

psmyrek commented Mar 16, 2026

I think the second installation just always succeeds?

Not really, at least in my env. I checked yarn install 5 times in a row and each time I got the same error.

@sheremet-va
Copy link
Member

I think the second installation just always succeeds?

Not really, at least in my env. I checked yarn install 5 times in a row and each time I got the same error.

Does it work if you delete node_modules?

@psmyrek
Copy link

psmyrek commented Mar 16, 2026

I think the second installation just always succeeds?

Not really, at least in my env. I checked yarn install 5 times in a row and each time I got the same error.

Does it work if you delete node_modules?

Unfortunately not. I checked it with only the package.json file as provided above, without any other files or directories.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to install vitest 4.1.0 with vite ^7.0.0 using yarn 1.x

4 participants