{"record":{"id":"149eadb1cab3fba6","repo":"angular/angular-cli","slug":"configuration-configuration-for-target-tar","errorCode":null,"errorMessage":"Configuration '${configuration}' for target '${target}' in project '${project}' is not set in the workspace.","messagePattern":"Configuration '(.+?)' for target '(.+?)' in project '(.+?)' is not set in the workspace\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/angular_devkit/architect/node/node-modules-architect-host.ts","lineNumber":93,"sourceCode":"  ) {\n    if ('getBuilderName' in workspaceOrHost) {\n      this.workspaceHost = workspaceOrHost;\n    } else {\n      this.workspaceHost = {\n        async getBuilderName(project, target) {\n          const { builder } = findProjectTarget(workspaceOrHost, project, target);\n\n          return builder;\n        },\n        async getOptions(project, target, configuration) {\n          const targetDefinition = findProjectTarget(workspaceOrHost, project, target);\n\n          if (configuration === undefined) {\n            return (targetDefinition.options ?? {}) as json.JsonObject;\n          }\n\n          if (!targetDefinition.configurations?.[configuration]) {\n            throw new Error(\n              `Configuration '${configuration}' for target '${target}' in project '${project}' is not set in the workspace.`,\n            );\n          }\n\n          return (targetDefinition.configurations?.[configuration] ?? {}) as json.JsonObject;\n        },\n        async getMetadata(project) {\n          const projectDefinition = workspaceOrHost.projects.get(project);\n          if (!projectDefinition) {\n            throw new Error(`Project \"${project}\" does not exist.`);\n          }\n\n          return {\n            root: projectDefinition.root,\n            sourceRoot: projectDefinition.sourceRoot,\n            prefix: projectDefinition.prefix,\n            ...(clone(workspaceOrHost.extensions) as {}),\n            ...(clone(projectDefinition.extensions) as {}),","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/architect/node/node-modules-architect-host.ts#L75-L111","documentation":"This error is thrown by the architect host's getOptionsForTarget when a named configuration (e.g. 'production') is requested for a target, but the target definition in angular.json has no entry under 'configurations' with that name. The workspace schema simply doesn't define that configuration for that project's target.","triggerScenarios":"Calling architect getOptionsForTarget/getTargetOptions with a configuration name that is absent from the target's 'configurations' object in angular.json, e.g. running 'ng build my-app --configuration staging' when only 'production' and 'development' are defined.","commonSituations":"Typo in --configuration flag value; CI pipeline referencing a configuration renamed or removed during an upgrade; copying an ng command from another project that had extra configurations.","solutions":["Add the missing configuration under the target's 'configurations' in angular.json, or","Run with an existing configuration name (check the target's configurations keys), or","Omit the --configuration flag so default options are used."],"exampleFix":"// before (angular.json target has no 'staging')\nng build --configuration staging\n// after (angular.json)\n\"configurations\": { \"staging\": { \"fileReplacements\": [\"src/environments/environment.staging.ts\"] } }","handlingStrategy":"validation","validationCode":"const cfg = workspace.projects.get(project)?.targets.get(target)?.configurations?.[configuration];\nif (cfg === undefined) throw new Error(`Configuration '${configuration}' is not defined for target '${target}' of project '${project}'.`);","typeGuard":null,"tryCatchPattern":"try { options = await host.getOptionsForTarget({ project, target, configuration }); } catch (e) { if (String(e.message).includes('is not set in the workspace')) { /* fall back to default options or fix angular.json */ } else throw e; }","preventionTips":["List valid configurations with `ng config projects.<name>.architect.<target>.configurations` before running.","Avoid hardcoding --configuration values in scripts; read them from angular.json.","Standardize configuration names across CI scripts."],"tags":["angular","configuration","workspace"],"backgroundTag":"missing-configuration-in-workspace","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}