{"record":{"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":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/vitest/src/node/core.ts","lineNumber":422,"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":404,"sourceCodeEnd":440,"githubUrl":"https://github.com/vitest-dev/vitest/blob/1fa9837ec26533512fdcad8baebf249771bd340a/packages/vitest/src/node/core.ts#L404-L440","documentation":"Vitest resolves the workspace into a list of `TestProject`s. If the user supplied a project filter (CLI `--project <name>` or config `project`) and that filter matched zero projects, the filter is almost certainly a typo. Vitest names the offending filter so it can be corrected.","triggerScenarios":"Running `vitest --project app-server` when the workspace only defines projects named `app` and `server`; quoting/glob mismatches in the filter.","commonSituations":"Rename of a project that wasn't reflected in a CI script; a monorepo filter using a display name instead of the configured project name.","solutions":["List the available project names (`vitest list` or inspect the workspace config) and correct the filter.","Drop the `--project` flag to run all projects.","Update CI scripts whenever a project is renamed."],"exampleFix":"# before\nvitest --project app-server\n# after (match the real name)\nvitest --project app","handlingStrategy":"validation","validationCode":"const requested = (process.argv.filter((_, i, a) => a[i - 1] === '--project'))\nconst known = (await vitest.collect()).map(p => p.name)\nconst missing = requested.filter(r => !known.includes(r))\nif (missing.length) {\n  throw new Error(`Unknown --project values: ${missing.join(', ')}. Known: ${known.join(', ')}`)\n}","typeGuard":"function isKnownProject(name: string, known: string[]): boolean {\n  return known.includes(name)\n}","tryCatchPattern":null,"preventionTips":["Keep a single source of truth for project names and reference it from CI scripts.","Add a CI lint step that validates `--project` flags against the workspace definition."],"tags":["cli","workspace","project-filter","config"],"backgroundTag":null,"analyzedSha":"1fa9837ec26533512fdcad8baebf249771bd340a","analyzedAt":"2026-08-11T16:11:39.638Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}