Cannot use same target name in angular.json for multiple projects
See original GitHub issueBug Report or Feature Request (mark with an x
)
- [ X ] bug report
Command (mark with an x
)
- [ X ] build
- [ X ] serve
Versions
7.0.0-beta.3 and 4.
Repro steps
Using an angular.json with multiple projects sharing the target name (ie, ‘serve’ and ‘build’ under the ‘architect’ node) will cause this error, even when specifying the project (ie. not a multiTarget). A recent change here caused this regression. It will give the error ‘Could not determine a single project for the ‘serve’ target.’ from within the call to getProjectNamesByTarget(), even though I have specified the project.
"projects": {
"stuff": {
"architect": {
"build": {
}
}
},
"morestuff": {
"architect": {
"build": {
The log given by the failure
Error: Could not determine a single project for the ‘serve’ target. at ServeCommand.getProjectNamesByTarget (/Stuff/Spore/Typescript/node_modules/@angular/cli/models/architect-command.js:167:19) at ServeCommand.initialize (/Stuff/Spore/Typescript/node_modules/@angular/cli/models/architect-command.js:75:39) at process._tickCallback (internal/process/next_tick.js:68:7) at Function.Module.runMain (internal/modules/cjs/loader.js:746:11) at startup (internal/bootstrap/node.js:238:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:572:3)
Desired functionality
Ability to still use the same target names, ‘build’, ‘serve’, etc… across numerous projects in the same angular.json. A workaround is to use unique names.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
err…ya, ok ill skip the repro unless you poke me again.
The error
Could not determine a single project for the 'serve' target.
is indicated that it cannot locate a single project when you usebuild
andrun
. Thus in order to use the these builders you’d need to provide the project name as an argument.Ex;