{"record":{"id":"411d91463d0c8470","repo":"ionic-team/ionic-framework","slug":"invalid-builder-for-projectname-buildconfig","errorCode":null,"errorMessage":"Invalid builder for ${projectName}: ${buildConfig.builder}","messagePattern":"Invalid builder for (.+?): (.+?)","errorType":"exception","errorClass":"SchematicsException","httpStatus":null,"severity":"error","filePath":"packages/angular/src/schematics/utils/config.ts","lineNumber":63,"sourceCode":"  return projectNames[0];\n}\n\nfunction getAngularJson(config: any, projectName: string): any | never {\n  // eslint-disable-next-line no-prototype-builtins\n  if (!config.projects.hasOwnProperty(projectName)) {\n    throw new SchematicsException(`Could not find project: ${projectName}`);\n  }\n\n  const projectConfig = config.projects[projectName];\n  if (isAngularBrowserProject(projectConfig)) {\n    return projectConfig;\n  }\n\n  if (config.projectType !== 'application') {\n    throw new SchematicsException(`Invalid projectType for ${projectName}: ${config.projectType}`);\n  } else {\n    const buildConfig = projectConfig.architect.build;\n    throw new SchematicsException(`Invalid builder for ${projectName}: ${buildConfig.builder}`);\n  }\n}\n\nexport function addStyle(host: Tree, projectName: string, stylePath: string): void {\n  const config = readConfig(host);\n  const angularJson = getAngularJson(config, projectName);\n  angularJson.architect.build.options.styles.push({\n    input: stylePath,\n  });\n  writeConfig(host, config);\n}\n\nexport function addAsset(\n  host: Tree,\n  projectName: string,\n  architect: string,\n  asset: string | { glob: string; input: string; output: string }\n): void {","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/ionic-team/ionic-framework/blob/625f9c38ad8c5db8a6c12df5c1622a36da90f9e3/packages/angular/src/schematics/utils/config.ts#L45-L81","documentation":"Thrown by getAngularJson() when the project is treated as an application but its `architect.build.builder` is not one of the three supported values: `@angular-devkit/build-angular:browser` (Angular <=16), `@angular-devkit/build-angular:application` (Angular 17), or `@angular/build:application` (Angular 18+). The message echoes the offending builder string so you can see exactly what was rejected.","triggerScenarios":"The targeted application project's `architect.build.builder` is a server, prerender, dev-server, custom, or newer/older unsupported builder (e.g. `@angular-devkit/build-angular:browser-esbuild`, `:dev-server`, `:prerender`, `:server`).","commonSituations":"Using an experimental or custom esbuild/webpack builder; upgrading Angular to a version whose default builder string is not yet recognized by the installed Ionic version; targeting a build target that is actually for SSR/prerendering rather than the browser bundle.","solutions":["Open angular.json and read `projects[<name>].architect.build.builder` shown in the error message.","Switch that builder to a supported value (e.g. `@angular/build:application` for Angular 18+).","If you need the unsupported builder, upgrade `@ionic/angular` to a version that recognizes it, or apply the schematic's changes to angular.json manually.","Re-run the schematic once the builder string matches a supported value."],"exampleFix":"// before\n\"build\": { \"builder\": \"@angular-devkit/build-angular:browser-esbuild\" }\n// after\n\"build\": { \"builder\": \"@angular/build:application\" }","handlingStrategy":"validation","validationCode":"import { readFileSync } from 'fs';\nconst SUPPORTED = new Set([\n  '@angular-devkit/build-angular:browser',\n  '@angular-devkit/build-angular:application',\n  '@angular/build:application',\n]);\nconst angularJson = JSON.parse(readFileSync('angular.json', 'utf8'));\nconst builder = angularJson.projects?.[projectName]?.architect?.build?.builder;\nif (!SUPPORTED.has(builder)) {\n  throw new Error(`Unsupported builder '${builder}'. Use one of: ${[...SUPPORTED].join(', ')}`);\n}","typeGuard":"const SUPPORTED_BUILDERS = new Set([\n  '@angular-devkit/build-angular:browser',\n  '@angular-devkit/build-angular:application',\n  '@angular/build:application',\n]);\nfunction isSupportedBuilder(builder: unknown): boolean {\n  return typeof builder === 'string' && SUPPORTED_BUILDERS.has(builder);\n}","tryCatchPattern":null,"preventionTips":["Keep your application on a supported Angular builder string before running Ionic schematics.","Upgrade @ionic/angular alongside Angular major upgrades so builder recognition stays current.","Avoid experimental builders when running schematics; switch back temporarily if needed."],"tags":["angular","schematics","configuration","builder"],"backgroundTag":null,"analyzedSha":"625f9c38ad8c5db8a6c12df5c1622a36da90f9e3","analyzedAt":"2026-08-12T16:00:25.413Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}