{"record":{"id":"658a306450b9aad7","repo":"vitest-dev/vitest","slug":"no-projects-were-found-make-sure-your-configurati","errorCode":null,"errorMessage":"No projects were found. Make sure your configuration is correct. ${globalConfig.project.length ? `The filter matched no projects: ${globalConfig.project.join(', ')}. ` : ''}The projects definition: ${JSON.stringify(definitions.map(...), null, 4)}.","messagePattern":"No projects were found\\. Make sure your configuration is correct\\. (.+?)\\. ` : ''\\}The projects definition: (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vitest/src/node/projects/resolveProjects.ts","lineNumber":202,"sourceCode":"  const seenNamesSet = new Set(seenNames.keys())\n\n  // Browser instance expansion (per-entry config injection).\n  const afterBrowser = expandBrowserInstancesInEntries(globalConfig, baseEntries, seenNamesSet)\n\n  // Benchmark expansion (per-entry config injection, runs over post-browser list).\n  // `--benchmark` makes every project run as a benchmark.\n  const afterBenchmark = expandBenchmarksInEntries(afterBrowser, seenNamesSet, !!globalConfig.cliOptions.benchmarkOnly)\n\n  // --project filter (applied after expansion so all candidate names are known).\n  const filtered = applyProjectFilter(globalConfig, afterBenchmark)\n\n  // If the user declared `projects` (or workspace files) but the filter\n  // excluded every candidate, throw with the projects definition included so\n  // callers see what was tried. Skipped for the runtime `injectTestProjects`\n  // path where filtering injected projects out is expected.\n  const filterMatched = filtered.some(entry => !entry.hidden)\n  if (throwIfEmpty && definitions && !filterMatched) {\n    throw new Error(\n      [\n        'No projects were found. Make sure your configuration is correct. ',\n        globalConfig.project.length ? `The filter matched no projects: ${globalConfig.project.join(', ')}. ` : '',\n        `The projects definition: ${JSON.stringify(\n          definitions.map((p, index) => typeof p === 'string'\n            ? p\n            : p instanceof Promise\n              ? 'Promise'\n              : typeof p === 'function'\n                ? p.name\n                : ({ name: p.test?.name ?? index })),\n          null,\n          4,\n        )}.`,\n      ].join(''),\n    )\n  }\n","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/vitest-dev/vitest/blob/1fa9837ec26533512fdcad8baebf249771bd340a/packages/vitest/src/node/projects/resolveProjects.ts#L184-L220","documentation":"After expanding browser instances, benchmarks, and applying the --project filter, if every candidate project is hidden/filtered out and projects were declared, Vitest throws. The message includes the active --project filters and a JSON summary of the projects definition so the user can see what was tried. Skipped for the runtime inject path where filtering is expected.","triggerScenarios":"User declares 'projects' (or a workspace file) but the --project CLI filter (globalConfig.project) excludes all of them, leaving no runnable project and throwIfEmpty is true.","commonSituations":"Passing --project with a name that matches none of the declared projects, a typo in the filter, renamed projects, or filters that became stale after refactoring.","solutions":["Run without --project to list available project names, then use the exact name.","Check for typos or stale names in your --project filter / scripts.","Ensure your projects definition actually yields the names you expect (see the JSON in the error).","If filtering programmatically, validate names against the declared set first."],"exampleFix":"// before\nvitest --project=unit-tests  // no such project\n// after - use the real name shown by 'vitest list'\nvitest --project=unit","handlingStrategy":"validation","validationCode":"// Validate --project filters against declared names before running.\nfunction assertFilterMatches(declared: string[], filter: string[]) {\n  const missing = filter.filter(f => !declared.includes(f))\n  if (missing.length) throw new Error(`--project filter matched nothing: ${missing.join(', ')}. Available: ${declared.join(', ')}`)\n}","typeGuard":"const filterIsSubset = (declared: string[], filter: string[]): boolean =>\n  filter.every(f => declared.includes(f))","tryCatchPattern":null,"preventionTips":["Run 'vitest list' to discover valid project names before filtering.","Keep CI filter scripts in sync with project names after refactors.","Fail fast in scripts if a filter name is unknown."],"tags":["projects","filter","cli","config"],"backgroundTag":null,"analyzedSha":"1fa9837ec26533512fdcad8baebf249771bd340a","analyzedAt":"2026-08-11T16:11:39.638Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}