Command
build
Is this a regression?
The previous version in which this bug was not present was
No response
Description
When no builder is configured in angular.json, the provided error message is unhelpful in determining the issue.
It would be nice if the CLI detected that no builder was defined and reported that error.
Suggestion: “You have not specified a builder with which to compile the project. Please add one in 'angular.json' under the key 'projects.project.architect.target.builder'”
Minimal Reproduction
- Create new project via
ng new ang and accept the default options
cd ang
- Open
angular.json and remove the key projects.ang.architect.build.builder
ng build
Exception or Error
An unhandled exception occurred: Cannot read properties of undefined (reading 'split')
See "/tmp/ng-zswHbS/angular-errors.log" for further details.
The mentioned file contains
[error] TypeError: Cannot read properties of undefined (reading 'split')
at WorkspaceNodeModulesArchitectHost.resolveBuilder (/home/mwaibel/tmp/ang/ang/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js:114:55)
at BuildCommandModule.getArchitectTargetOptions (/home/mwaibel/tmp/ang/ang/node_modules/@angular/cli/src/command-builder/architect-base-command-module.js:147:47)
at async BuildCommandModule.builder (/home/mwaibel/tmp/ang/ang/node_modules/@angular/cli/src/command-builder/architect-command-module.js:53:31)
at async runCommand (/home/mwaibel/tmp/ang/ang/node_modules/@angular/cli/src/command-builder/command-runner.js:73:5)
at async default_1 (/home/mwaibel/tmp/ang/ang/node_modules/@angular/cli/lib/cli/index.js:70:16)
Your Environment
Tested in all of these:
Angular CLI: 17.3.11
Node: 18.20.4
Package Manager: npm 10.9.1
OS: linux x64
Angular: 17.3.12
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1703.11
@angular-devkit/build-angular 17.3.11
@angular-devkit/core 17.3.11
@angular-devkit/schematics 17.3.11
@angular/cli 17.3.11
@schematics/angular 17.3.11
rxjs 7.8.1
typescript 5.4.5
zone.js 0.14.10
Angular CLI: 18.2.12
Node: 18.20.4
Package Manager: npm 10.9.1
OS: linux x64
Angular: 18.2.13
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1802.12
@angular-devkit/build-angular 18.2.12
@angular-devkit/core 18.2.12
@angular-devkit/schematics 18.2.12
@angular/cli 18.2.12
@schematics/angular 18.2.12
rxjs 7.8.1
typescript 5.4.5
zone.js 0.14.10
Angular CLI: 19.0.6
Node: 18.20.4
Package Manager: npm 10.9.1
OS: linux x64
Angular: 19.0.5
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1900.6
@angular-devkit/build-angular 19.0.6
@angular-devkit/core 19.0.6 (cli-only)
@angular-devkit/schematics 19.0.6
@angular/cli 19.0.6
@schematics/angular 19.0.6
rxjs 7.8.1
typescript 5.6.3
zone.js 0.15.0
Anything else relevant?
no response
Command
build
Is this a regression?
The previous version in which this bug was not present was
No response
Description
When no builder is configured in
angular.json, the provided error message is unhelpful in determining the issue.It would be nice if the CLI detected that no builder was defined and reported that error.
Suggestion: “You have not specified a builder with which to compile the project. Please add one in 'angular.json' under the key 'projects.project.architect.target.builder'”
Minimal Reproduction
ng new angand accept the default optionscd angangular.jsonand remove the keyprojects.ang.architect.build.builderng buildException or Error
The mentioned file contains
Your Environment
Tested in all of these:
Anything else relevant?
no response