{"record":{"id":"899fd2e46e6edb5c","repo":"angular/components","slug":"your-project-is-not-using-the-default-builders-for-899fd2","errorCode":null,"errorMessage":"Your project is not using the default builders for \"${targetName}\". This means that we cannot add the configured theme to the \"${targetName}\" target.","messagePattern":"Your project is not using the default builders for \"(.+?)\"\\. This means that we cannot add the configured theme to the \"(.+?)\" target\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/material/schematics/ng-add/theming/theming.ts","lineNumber":172,"sourceCode":"    targetName === 'test' ? getProjectTestTargets(project) : getProjectBuildTargets(project);\n  const isDefaultBuilder = targets.length > 0;\n\n  // Because the build setup for the Angular CLI can be customized by developers, we can't know\n  // where to put the theme file in the workspace configuration if custom builders are being\n  // used. In case the builder has been changed for the \"build\" target, we throw an error and\n  // exit because setting up a theme is a primary goal of `ng-add`. Otherwise if just the \"test\"\n  // builder has been changed, we warn because a theme is not mandatory for running tests\n  // with Material. See: https://github.com/angular/components/issues/14176\n  if (!isDefaultBuilder && targetName === 'build') {\n    throw new SchematicsException(\n      `Your project is not using the default builders for ` +\n        `\"${targetName}\". The Angular Material schematics cannot add a theme to the workspace ` +\n        `configuration if the builder has been changed.`,\n    );\n  } else if (!isDefaultBuilder) {\n    // for non-build targets we gracefully report the error without actually aborting the\n    // setup schematic. This is because a theme is not mandatory for running tests.\n    logger.warn(\n      `Your project is not using the default builders for \"${targetName}\". This ` +\n        `means that we cannot add the configured theme to the \"${targetName}\" target.`,\n    );\n  }\n\n  return isDefaultBuilder;\n}\n","sourceCodeStart":154,"sourceCodeEnd":180,"githubUrl":"https://github.com/angular/components/blob/0411926e7d8ae06b32236ec1048a888cfad5abf2/src/material/schematics/ng-add/theming/theming.ts#L154-L180","documentation":"The Material ng-add schematic's validateDefaultTargetBuilder checks that the workspace's build/test/serve targets use the default Angular builders (e.g. @angular-devkit/build-angular:application or browser). If the target uses a custom or third-party builder, the schematic cannot safely inject the theme path into the build configuration, so for non-build targets (like test) it only logs this warning and returns false. For the build target it throws a harder error.","triggerScenarios":"Running `ng add @angular/material` in a workspace whose angular.json configures a non-default builder for the target named targetName (e.g. a custom webpack builder, Nx builders, or @angular-builders/* packages).","commonSituations":"Nx/Custom Angular CLI workspaces with swapped builders; projects using esbuild-based or webpack-custom builders; monorepos where architect targets were renamed or replaced; older projects migrated to new builders leaving stale target configs.","solutions":["Switch the target's builder in angular.json back to the default (@angular-devkit/build-angular:application/browser or :karma) and re-run ng add.","Manually add the generated theme file to your custom builder's styles config (styles: [\"src/custom-theme.scss\"]) after creating the theme yourself.","Ignore the warning if the target is 'test' — themes are not mandatory for running tests."],"exampleFix":"// before (angular.json)\n\"builder\": \"@angular-builders/custom-webpack:browser\"\n// after\n\"builder\": \"@angular-devkit/build-angular:application\"\n// and add src/custom-theme.scss to \"options.styles\"","handlingStrategy":"validation","validationCode":"const cfg = workspace.projects[project].architect[targetName];\nconst DEFAULT_BUILDERS = [\n  '@angular-devkit/build-angular:application',\n  '@angular-devkit/build-angular:browser'\n];\nconst isDefault = DEFAULT_BUILDERS.includes(cfg?.builder);\nif (!isDefault) console.warn(`Manual theme wiring needed for target ${targetName}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep default builders in angular.json, or know your custom builder's styles config location.","After ng add, always verify the theme file appears in the target's styles array.","In monorepos (Nx/Bazel), pre-check builder names before running Material schematics."],"tags":["angular","schematics","angular-json","builders","material-theme"],"backgroundTag":"non-default-builder-config","analyzedSha":"0411926e7d8ae06b32236ec1048a888cfad5abf2","analyzedAt":"2026-08-31T11:58:23.400Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}