{"record":{"id":"479e2eced95cc926","repo":"vitest-dev/vitest","slug":"vitest-wasn-t-able-to-resolve-any-project","errorCode":null,"errorMessage":"Vitest wasn't able to resolve any project.","messagePattern":"Vitest wasn't able to resolve any project\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/vitest/src/node/core.ts","lineNumber":429,"sourceCode":"    }))\n\n    if (resolved.cliOptions.browser?.enabled) {\n      const browserProjects = this.projects.filter(p => p.config.browser.enabled)\n      if (!browserProjects.length) {\n        throw new Error(`Vitest received --browser flag, but no project had a browser configuration.`)\n      }\n    }\n    if (!this.projects.length) {\n      const filter = toArray(resolved.project).join('\", \"')\n      if (filter) {\n        throw new Error(`No projects matched the filter \"${filter}\".`)\n      }\n      else {\n        let error = `Vitest wasn't able to resolve any project.`\n        if (resolved.browser.enabled && !resolved.browser.instances?.length) {\n          error += ` Please, check that you specified the \"browser.instances\" option.`\n        }\n        throw new Error(error)\n      }\n    }\n\n    if (!this.coreWorkspaceProject) {\n      this.coreWorkspaceProject = TestProject._createBasicProject(this)\n    }\n\n    if (resolved.testNamePattern) {\n      this.configOverride.testNamePattern = resolved.testNamePattern\n    }\n\n    // populate will merge all configs into every project,\n    // we don't want that when just listing tags\n    if (!resolved.listTags) {\n      populateProjectsTags(this.coreWorkspaceProject, this.projects)\n    }\n\n    this.reporters = await createReporters(resolved.reporters, this)","sourceCodeStart":411,"sourceCodeEnd":447,"githubUrl":"https://github.com/vitest-dev/vitest/blob/1fa9837ec26533512fdcad8baebf249771bd340a/packages/vitest/src/node/core.ts#L411-L447","documentation":"If after resolving the workspace Vitest has zero projects AND no project filter was supplied, the workspace resolution itself failed to produce anything runnable. When browser mode is enabled but no `browser.instances` were declared, the message is augmented to point at that specific cause; otherwise it is a generic resolution failure.","triggerScenarios":"An empty workspace file; a config that excludes everything via `include`/`exclude`; browser mode enabled without `browser.instances`; a misnamed config file that Vitest did not load.","commonSituations":"Fresh repo with no tests matching the default glob; `include` pattern pointing at a non-existent directory; browser config that sets `enabled: true` but forgets the instances array.","solutions":["Verify your `vitest.config.ts` / workspace file is at the project root and is valid.","Check the `include` globs actually match at least one test file.","If `browser.enabled: true`, add at least one entry to `browser.instances`.","Run with `--debug` or `vitest list` to see what Vitest resolved."],"exampleFix":"// before\ntest: { browser: { enabled: true } }   // no instances\n// after\ntest: { browser: { enabled: true, instances: [{ browser: 'chromium' }] } }","handlingStrategy":"validation","validationCode":"import { globSync } from 'tinyglobby'\nconst hasTests = globSync(['**/*.test.ts', '**/*.spec.ts'], { ignore: ['node_modules/**'] }).length > 0\nif (!hasTests) {\n  throw new Error('No test files matched the default include globs.')\n}\nif (config.test?.browser?.enabled && !(config.test.browser.instances?.length)) {\n  throw new Error('browser.enabled requires at least one browser.instances entry.')\n}","typeGuard":"function hasBrowserInstances(cfg: any): boolean {\n  return Array.isArray(cfg?.test?.browser?.instances) && cfg.test.browser.instances.length > 0\n}","tryCatchPattern":null,"preventionTips":["Smoke-test a fresh checkout with `vitest list` to confirm resolution before CI.","When enabling browser mode, immediately add at least one instance in the same commit."],"tags":["workspace","config","browser","resolution"],"backgroundTag":null,"analyzedSha":"1fa9837ec26533512fdcad8baebf249771bd340a","analyzedAt":"2026-08-11T16:11:39.638Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}