-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running a single project with browsers fails with Cannot read properties of undefined (reading 'provider')
#7308
Comments
I'm getting the same, it might be related to this line vitest/packages/browser/src/node/pool.ts Line 147 in fa4634b
function getThreadsCount(project: TestProject) {
const config = project.config.browser
// this line, it should be `project.config.browser`
if (!config.headless || !project.browser!.provider.supportsParallelism) {
return 1
}
if (!config.fileParallelism) {
return 1
}
return vitest.config.watch
? Math.max(Math.floor(numCpus / 2), 1)
: Math.max(numCpus - 1, 1)
} |
Actually there appear to be a few references looking for |
The code you mention is correct, The error lies in another place. The filter is applied incorrectly to projects with This should be fixed in the next patch. |
Describe the bug
When running a single Vitest project with
npx vitest run --project=myproject
and a browser configuration, Vitest fails with:Running without the project specifier (
npx vitest run
) works without issues. Running with browsers disabled works too.It fails regardless if you use the new
instances
configuration structure or if you use the oldname
property.The bug was introduced in v3.0.0-beta.3, as v3.0.0-beta.2 does not appear to exhibit this behavior. Most likely as a result of #6975 .
Reproduction
See reproduction at https://github.com/JReinhold/vitest-browser-config-project-bug
git clone [email protected]:jreinhold/vitest-browser-config-project-bug.git
cd vitest-browser-config-project-bug
npm install
npx playwright install
npx vitest run
npx vitest run --project=myproject
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: