{"record":{"id":"f6cbe0563d09ca60","repo":"angular/angular-cli","slug":"project-name-options-project-doesn-t-not-exis-f6cbe0","errorCode":null,"errorMessage":"Project name \"${options.project}\" doesn't not exist.","messagePattern":"Project name \"(.+?)\" doesn't not exist\\.","errorType":"exception","errorClass":"SchematicsException","httpStatus":null,"severity":"error","filePath":"packages/schematics/angular/config/index.ts","lineNumber":50,"sourceCode":"        return addKarmaConfig(options);\n      case ConfigType.Browserslist:\n        return addBrowserslistConfig(project.root);\n      case ConfigType.Vitest:\n        return addVitestConfig(options);\n      default:\n        throw new SchematicsException(`\"${options.type}\" is an unknown configuration file type.`);\n    }\n  },\n);\n\nexport default configSchematic;\n\nfunction addVitestConfig(options: ConfigOptions): Rule {\n  return (tree, context) =>\n    updateWorkspace((workspace) => {\n      const project = workspace.projects.get(options.project);\n      if (!project) {\n        throw new SchematicsException(`Project name \"${options.project}\" doesn't not exist.`);\n      }\n\n      const testTarget = project.targets.get('test');\n      if (!testTarget) {\n        throw new SchematicsException(\n          `No \"test\" target found for project \"${options.project}\".` +\n            ' A \"test\" target is required to generate a Vitest configuration.',\n        );\n      }\n\n      if (testTarget.builder !== AngularBuilder.BuildUnitTest) {\n        throw new SchematicsException(\n          `Cannot add a Vitest configuration as builder for \"test\" target in project does not` +\n            ` use \"${AngularBuilder.BuildUnitTest}\".`,\n        );\n      }\n\n      testTarget.options ??= {};","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/schematics/angular/config/index.ts#L32-L68","documentation":"The `config` schematic's Vitest branch (`addVitestConfig`) looks up the requested project in the workspace via `workspace.projects.get(options.project)` and throws this SchematicsException when no project with that exact name is registered in `angular.json` (or the workspace definition). It exists to fail fast instead of silently generating a config for a non-existent project. Note the message itself has a typo (\"doesn't not exist\") but the meaning is unambiguous: the project name could not be found.","triggerScenarios":"Running `ng generate config <project> --type vitest` (or invoking the config schematic programmatically) with a `--project` value that does not match any project key in angular.json — e.g. a typo, a dasherized vs camelCase mismatch, a deleted/renamed project, or omitting the project in a multi-project workspace where the default cannot be resolved to a real name.","commonSituations":"Monorepo users pointing at a library that was renamed; CI scripts with hard-coded project names after a reorganization; running the schematic before `ng add`/`ng generate application` created the project; copy-pasting a package.json name (npm scope name) instead of the angular.json project name.","solutions":["Run `ng generate config --help` / open angular.json and copy the exact project key under `\"projects\"` for the `--project` flag.","List available projects with `ng generate config` in the workspace root or inspect angular.json to confirm the project exists and was not renamed or deleted.","If the project was recently renamed, update scripts/CI to the new name, or restore the project entry in angular.json."],"exampleFix":"// before\nng g config my-appp --type vitest\n// after\nng g config my-app --type vitest","handlingStrategy":"validation","validationCode":"import { workspaces } from '@angular-devkit/core';\n// or simply:\nconst angularJson = JSON.parse(tree.read('angular.json')!.toString('utf8'));\nif (!angularJson.projects?.[options.project]) {\n  throw new Error(`Project \"${options.project}\" not in angular.json`);\n}","typeGuard":"function projectExists(name: string, projects: Record<string, unknown>): boolean {\n  return typeof name === 'string' && Object.prototype.hasOwnProperty.call(projects, name);\n}","tryCatchPattern":"try {\n  await schematicRunner.runSchematic('config', { project, type: 'vitest' });\n} catch (e) {\n  if (e instanceof SchematicsException && e.message.includes('doesn\\'t not exist')) {\n    console.error(`Unknown project \"${project}\". Check angular.json projects keys.`);\n  } else throw e;\n}","preventionTips":["Always pass `--project` with the exact key from angular.json, not the package.json name.","Run `ng generate` from the workspace root.","Keep a workspace projects list in CI to validate project names before running schematics."],"tags":["angular","schematics","angular-json","project-not-found"],"backgroundTag":"project-not-found-in-workspace","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}