{"id":"21947d942de90f01","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((p, index) => typeof p === 'string' ? p : p instanceof Promise ? 'Promise' : typeof p === 'function' ? p.name : ({ name: p.test?.name ?? index })), null, 4)}.","messagePattern":"No projects were found\\. Make sure your configuration is correct\\. (.+?)\\. ` : ''\\}The projects definition: (.+?)\\)\\), null, 4\\)\\}\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vitest/src/node/projects/resolveProjects.ts","lineNumber":199,"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":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/vitest-dev/vitest/blob/d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09/packages/vitest/src/node/projects/resolveProjects.ts#L181-L217","documentation":"Thrown at the end of resolution (resolveProjects.ts:198-216) when projects were declared (definitions is truthy) but after browser/benchmark expansion and the --project filter, no visible entry remains. The message echoes the --project filter (if any) and a JSON dump of the raw definitions so you can see what was tried.","triggerScenarios":"The projects array resolves to zero entries (e.g. globs match nothing); every project is hidden by an overly narrow --project filter; all definitions are Promises that reject (those surface in 287 instead) or filter out; definitions reference paths that produce no project.","commonSituations":"Running vitest --project=nonexistent where nonexistent matches nothing; a glob like 'packages/*/vitest.config.ts' in a repo with no such files; renaming projects but keeping an old --project flag in CI; misconfigured projects: [] (empty array treated as empty workspace).","solutions":["Drop or correct the --project filter so it matches at least one resolved project name.","Verify the projects globs/paths actually match files (run a dry glob yourself).","If projects: [] was set by mistake, remove it or provide at least one definition.","Inspect the dumped definitions JSON in the error to confirm names match your filter (use the same casing/label)."],"exampleFix":"// before\nexport default defineConfig({ test: { projects: ['packages/*/vitest.config.ts'] } })\n// run: vitest --project=unit  (no project named 'unit')\n\n// after: either fix the filter or the glob\nvitest --project=web  // matches a real project name","handlingStrategy":"validation","validationCode":"if (definitions.length === 0 && throwIfEmpty) {\n  throw new Error('projects array is empty')\n}\nconst resolvedNames = entries.map(e => e.projectConfig.name)\nif (filter.length && !resolvedNames.some(n => matchesProjectFilter(filter, n))) {\n  throw new Error(`--project filter '${filter}' matches none of: ${resolvedNames.join(', ')}`)\n}","typeGuard":"function filterMatchesAny(filter: string[], names: string[]): boolean {\n  return names.some(n => matchesProjectFilter(filter, n))\n}","tryCatchPattern":null,"preventionTips":["Dry-run globs to confirm they match files before adding to projects.","Keep CI's --project flags in sync with actual project names after renames.","Avoid projects: [] unless you intentionally want an empty workspace."],"tags":["projects","filter","cli","configuration","empty-results"],"analyzedSha":"d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09","analyzedAt":"2026-08-03T20:23:56.861Z","schemaVersion":2}