{"id":"7f1532a84dffc39e","repo":"vitest-dev/vitest","slug":"no-projects-matched-the-filter-filter","errorCode":null,"errorMessage":"No projects matched the filter \"${filter}\".","messagePattern":"No projects matched the filter \"(.+?)\"\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vitest/src/node/core.ts","lineNumber":423,"sourceCode":"          if (!this._warnedExperimentalCacheKeyGenerator) {\n            this._warnedExperimentalCacheKeyGenerator = true\n            this.logger.deprecate('`experimental_defineCacheKeyGenerator` is deprecated. Use `defineCacheKeyGenerator` instead.')\n          }\n          this._fsCache.defineCacheKeyGenerator(callback)\n        },\n      }))\n    }))\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","sourceCodeStart":405,"sourceCodeEnd":441,"githubUrl":"https://github.com/vitest-dev/vitest/blob/d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09/packages/vitest/src/node/core.ts#L405-L441","documentation":"When `--project <name>` (or `test.project` in config) filters the workspace, Vitest keeps only projects whose name matches. If none match, core.ts:420-424 throws listing the filter(s) you passed, so you know the filter itself is wrong rather than silently running nothing.","triggerScenarios":"Run `vitest --project nonexistent` or `vitest --project unit --project e2e` when the workspace only has projects named 'app' and 'lib'.","commonSituations":"Typo in the project name; renaming a project without updating CI scripts; filter referencing an old project name after a refactor.","solutions":["Check the available project names (e.g. via `vitest --list` or your workspace file) and correct the filter.","Ensure each project sets `test.name` to the value you are filtering on.","Remove the --project flag to run all projects if filtering is not required."],"exampleFix":"# before\nvitest --project unttests\n# after\nvitest --project unit-tests","handlingStrategy":"validation","validationCode":"function assertProjectFilterMatches(names: string[], filter: string[]) {\n  const matched = filter.some(f => names.includes(f))\n  if (filter.length && !matched) throw new Error(`No project matched filter ${filter.join(', ')}. Available: ${names.join(', ')}`)\n}","typeGuard":"function projectFilterMatches(names: string[], filter: string[]): boolean {\n  return filter.length === 0 || filter.some(f => names.includes(f))\n}","tryCatchPattern":null,"preventionTips":["List project names before filtering (vitest --list or workspace file).","Keep CI scripts in sync after renaming projects.","Set explicit test.name on every project to make filters stable."],"tags":["cli","workspace","project-filter","config"],"analyzedSha":"d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09","analyzedAt":"2026-08-03T20:23:56.861Z","schemaVersion":2}