{"record":{"id":"fe30bdd44fb0f26b","repo":"angular/angular-cli","slug":"project-options-project-does-not-have-a-build","errorCode":null,"errorMessage":"Project \"${options.project}\" does not have a build target.","messagePattern":"Project \"(.+?)\" does not have a build target\\.","errorType":"exception","errorClass":"SchematicsException","httpStatus":null,"severity":"error","filePath":"packages/schematics/angular/tailwind/index.ts","lineNumber":44,"sourceCode":"  InstallBehavior,\n  ProjectDefinition,\n  addDependency,\n  updateWorkspace,\n} from '../utility';\nimport { JSONFile } from '../utility/json-file';\nimport { latestVersions } from '../utility/latest-versions';\nimport { createProjectSchematic } from '../utility/project';\nimport { Schema as TailwindOptions } from './schema';\n\nconst TAILWIND_DEPENDENCIES = ['tailwindcss', '@tailwindcss/postcss', 'postcss'];\nconst POSTCSS_CONFIG_FILES = ['.postcssrc.json', 'postcss.config.json'];\n\nfunction addTailwindStyles(options: { project: string }, project: ProjectDefinition): Rule {\n  return async (tree) => {\n    const buildTarget = project.targets.get('build');\n\n    if (!buildTarget) {\n      throw new SchematicsException(`Project \"${options.project}\" does not have a build target.`);\n    }\n\n    const styles = buildTarget.options?.['styles'] as (string | { input: string })[] | undefined;\n\n    let stylesheetPath: string | undefined;\n    if (styles) {\n      stylesheetPath = styles\n        .map((s) => (typeof s === 'string' ? s : s.input))\n        .find((p) => p.endsWith('.css'));\n    }\n\n    if (!stylesheetPath) {\n      const newStylesheetPath = join(project.sourceRoot ?? 'src', 'tailwind.css');\n      tree.create(newStylesheetPath, `@import 'tailwindcss';\\n`);\n\n      return updateWorkspace((workspace) => {\n        const project = workspace.projects.get(options.project);\n        if (project) {","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/schematics/angular/tailwind/index.ts#L26-L62","documentation":"The Tailwind schematic (ng add / ng generate tailwind config wiring) inserts the stylesheet into the project's `build` target options. If the project has no target named `build`, the schematic cannot find where to register styles and throws this SchematicsException.","triggerScenarios":"Running the tailwind schematic on a project whose angular.json entry defines no `build` architect target — e.g. custom target names like `build-app`, library-only projects, or hand-trimmed angular.json.","commonSituations":"Projects using nonstandard target names; libraries without an application build target; workspaces where the build target was renamed for multi-app setups.","solutions":["Add a `build` target (architect section) to the project in angular.json.","Rename your custom build target to `build`, or configure the styles array manually: add \"styles\": [\"src/styles.css\"] plus tailwind.config.js yourself.","Run the schematic against a project that has a standard `build` target (`--project <app-name>`)."],"exampleFix":"// before (angular.json)\n\"architect\": { \"build-app\": { \"options\": {} } }\n// after\n\"architect\": { \"build\": { \"builder\": \"...\", \"options\": { \"styles\": [\"src/styles.css\"] } } }","handlingStrategy":"validation","validationCode":"const project = workspace.projects.get(options.project);\nif (!project?.targets.get('build')) {\n  throw new Error(`Project ${options.project} has no build target; the Tailwind schematic requires one.`);\n}","typeGuard":"function hasBuildTarget(p?: { targets: Map<string, unknown> }): boolean {\n  return !!p?.targets?.has('build');\n}","tryCatchPattern":"try {\n  await ngAdd('tailwindcss');\n} catch (e) {\n  if (String(e?.message).includes('does not have a build target')) {\n    console.error('Add a build target to the project in angular.json or pick an application project.');\n  }\n  throw e;\n}","preventionTips":["Only run the Tailwind schematic against application projects that have a `build` target.","Use standard target name `build` for your applications.","For libraries, configure Tailwind via postcss config and the consuming app's styles instead.","Check angular.json's architect section before running workspace-wide schematic scripts."],"tags":["angular","schematics","tailwind","angular-json","build-target"],"backgroundTag":"missing-build-target","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}