{"record":{"id":"5f29ec9a80e2c61a","repo":"angular/angular-cli","slug":"invalid-project-name-projectname","errorCode":null,"errorMessage":"Invalid project name (${projectName})","messagePattern":"Invalid project name \\((.+?)\\)","errorType":"exception","errorClass":"SchematicsException","httpStatus":null,"severity":"error","filePath":"packages/schematics/angular/ssr/index.ts","lineNumber":347,"sourceCode":"        install,\n      }),\n    );\n  }\n\n  return chain(rules);\n}\n\nfunction addServerFile(\n  projectSourceRoot: string,\n  options: ServerOptions,\n  isStandalone: boolean,\n): Rule {\n  return async (host) => {\n    const projectName = options.project;\n    const workspace = await readWorkspace(host);\n    const project = workspace.projects.get(projectName);\n    if (!project) {\n      throw new SchematicsException(`Invalid project name (${projectName})`);\n    }\n    const usingApplicationBuilder = isUsingApplicationBuilder(project);\n    const browserDistDirectory = usingApplicationBuilder\n      ? (await getApplicationBuilderOutputPaths(host, projectName)).browser\n      : await getLegacyOutputPaths(host, projectName, 'build');\n\n    return mergeWith(\n      apply(url(`./files/${usingApplicationBuilder ? 'application-builder' : 'server-builder'}`), [\n        applyTemplates({\n          ...strings,\n          ...options,\n          browserDistDirectory,\n          isStandalone,\n        }),\n        move(projectSourceRoot),\n      ]),\n    );\n  };","sourceCodeStart":329,"sourceCodeEnd":365,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/schematics/angular/ssr/index.ts#L329-L365","documentation":"addServerFile resolves the project named by `options.project` in the workspace to generate server.ts and wire build targets. If no project with that name exists in angular.json, it throws this SchematicsException early.","triggerScenarios":"Running the ssr schematic with `--project` set to a name not present in `projects` of angular.json; typo in the project name; running in a repo where angular.json doesn't contain the expected project.","commonSituations":"Typos like `--project myapp` vs `my-app`; running after renaming a project without updating scripts/CI; monorepos where the schematic is invoked against another package's name.","solutions":["List valid projects with `ng list` (or check `projects` in angular.json) and pass the exact name via `--project`.","Fix the project name typo in your command/script.","If the project was renamed, rename it back in angular.json or update all references before running the schematic."],"exampleFix":"// before\nng add @angular/ssr --project myapp\n// after\nng add @angular/ssr --project my-app","handlingStrategy":"validation","validationCode":"import { readFileSync, existsSync } from 'fs';\nconst aj = JSON.parse(readFileSync('angular.json', 'utf8'));\nconst name = 'my-app'; // value you pass via --project\nif (!existsSync('angular.json') || !aj.projects?.[name]) {\n  throw new Error(`Project \"${name}\" not found. Valid: ${Object.keys(aj.projects ?? {}).join(', ')}`);\n}","typeGuard":"null","tryCatchPattern":"try {\n  await runSchematic('ng-add', { project: name });\n} catch (e) {\n  if (String(e?.message).startsWith('Invalid project name')) {\n    console.error(`Check project names with \"ng list\"; you passed: ${name}`);\n  }\n  throw e;\n}","preventionTips":["Verify the project name with `ng list` before running the schematic.","Copy/paste project keys from angular.json instead of retyping them.","Update scripts/CI after renaming projects in angular.json.","Use consistent project naming conventions across the monorepo."],"tags":["angular","schematics","ssr","angular-json","invalid-project"],"backgroundTag":"project-not-found-in-workspace","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}