{"record":{"id":"e6571a0a1713c6cb","repo":"angular/angular-cli","slug":"cannot-update-project-projectname-to-use-the-e6571a","errorCode":null,"errorMessage":"Cannot update project \"${projectName}\" to use the application builder as the server tsconfig cannot be located.","messagePattern":"Cannot update project \"(.+?)\" to use the application builder as the server tsconfig cannot be located\\.","errorType":"exception","errorClass":"SchematicsException","httpStatus":null,"severity":"error","filePath":"packages/schematics/angular/migrations/use-application-builder/migration.ts","lineNumber":116,"sourceCode":"    delete options['buildOptimizer'];\n    delete options['main'];\n    delete options['ngswConfigPath'];\n  }\n\n  // Merge browser and server tsconfig\n  if (serverTarget) {\n    const browserTsConfig = buildTarget.options?.tsConfig;\n    const serverTsConfig = serverTarget.options?.tsConfig;\n\n    if (typeof browserTsConfig !== 'string') {\n      throw new SchematicsException(\n        `Cannot update project \"${projectName}\" to use the application builder` +\n          ` as the browser tsconfig cannot be located.`,\n      );\n    }\n\n    if (typeof serverTsConfig !== 'string') {\n      throw new SchematicsException(\n        `Cannot update project \"${projectName}\" to use the application builder` +\n          ` as the server tsconfig cannot be located.`,\n      );\n    }\n\n    const browserJson = new JSONFile(tree, browserTsConfig);\n    const serverJson = new JSONFile(tree, serverTsConfig);\n\n    const filesPath = ['files'];\n\n    const files = new Set([\n      ...((browserJson.get(filesPath) as string[] | undefined) ?? []),\n      ...((serverJson.get(filesPath) as string[] | undefined) ?? []),\n    ]);\n\n    // Server file will be added later by the means of the ssr schematic.\n    files.delete('server.ts');\n","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/schematics/angular/migrations/use-application-builder/migration.ts#L98-L134","documentation":"Thrown by the use-application-builder migration when converting a legacy browser/server (Universal) project to the application builder. The migration located the browser tsconfig but could not resolve the server tsconfig to a string path, so it cannot rewire build options safely and aborts the project update.","triggerScenarios":"Running `ng update` / the use-application-builder migration on a project that has a server builder configured (e.g. @angular-devkit/build-angular:server) but whose server tsconfig path cannot be resolved from the build target options (missing/renamed 'tsConfig' option, or pointing to a nonexistent file).","commonSituations":"Projects upgraded across multiple Angular major versions where server tsconfig was renamed (tsconfig.server.json moved or deleted); hand-edited angular.json with server target options lacking tsConfig; Universal/SSR setups partially removed.","solutions":["Open angular.json and ensure the server build target has a valid 'tsConfig' option pointing to an existing tsconfig file (e.g. tsconfig.server.json).","If SSR was removed, delete the server build target and related architect targets before re-running the migration.","Recreate tsconfig.server.json (or run `ng add @angular/ssr`) so the server tsconfig exists, then re-run the migration.","Verify the referenced tsconfig file exists on disk at the path given in angular.json."],"exampleFix":"// before (angular.json)\n\"server\": { \"options\": { \"main\": \"server.ts\" } }\n// after\n\"server\": { \"options\": { \"main\": \"server.ts\", \"tsConfig\": \"tsconfig.server.json\" } }","handlingStrategy":"validation","validationCode":"const serverTs = project.architect?.server?.options?.tsConfig;\nif (typeof serverTs !== 'string' || !fs.existsSync(serverTs)) {\n  throw new Error(`Server tsconfig missing for project; fix angular.json before migrating.`);\n}","typeGuard":"function hasServerTsConfig(p: any): p is { architect: { server: { options: { tsConfig: string } } } } {\n  return typeof p?.architect?.server?.options?.tsConfig === 'string';\n}","tryCatchPattern":"try {\n  await runMigration('use-application-builder');\n} catch (e) {\n  if (String(e.message).includes('server tsconfig cannot be located')) {\n    logger.warn('Fix the server target tsConfig in angular.json and re-run.');\n  } else throw e;\n}","preventionTips":["Keep tsConfig set on every server build target in angular.json","Never delete tsconfig.server.json without updating angular.json","Run `ng update` migrations one major version at a time","Validate angular.json against the builder schema before migrating"],"tags":["angular","migration","tsconfig","builder"],"backgroundTag":"tsconfig-not-found","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}