Architect-cli, running serve target results in Data path "" should NOT have additional properties(_). #18889
Labels
area: @angular-devkit/architect
freq1: low
Only reported by a handful of users who observe it rarely
severity5: regression
type: bug/fix
Milestone
🐞 Bug report
Command (mark with an
x
)Is this a regression?
Yes, the previous version in which this bug was not present was: ....This bug is a regression. It looks like it is related to the refactoring to get ready for TS 4 (a85ba99?branch=a85ba990eb9482e630ba78b6b8417edeb1499b21&diff=unified#diff-b2c222e0f78a5c4cf888115c56457e2dR87).
In particular a change to this line: https://github.com/angular/angular-cli/blame/a85ba990eb9482e630ba78b6b8417edeb1499b21/packages/angular_devkit/architect_cli/bin/architect.ts#L87
Description
A clear and concise description of the problem...When running a serve target through the architect cli, it results in a schema validation error "Data path "" should NOT have additional properties(_)."
Tracing through the code, it looks like the validation error was caused by the build options schema.
It looks like minimalist npm library introduces an extra _ property when parsing args and those args are passed directly as build options for the serve target. In the refactor commit mentioned above, it looks like the code changed from
delete argv['_']
toargv['_']=[]
, this looks to be the source of the problem.I did try reverting the line back to delete and the serve worked as expected. This could affect other targets, it just manifested under the serve target for me.
🔬 Minimal Reproduction
To reproduce, create new project
> ng new cli-bug
Install architect-cli
> npm install @angular-devkit/architect-cli --save-dev
modify
package.json
to run architect cli instead of angular cli.run start via:
> npm run start
🔥 Exception or Error
🌍 Your Environment
Anything else relevant?
The text was updated successfully, but these errors were encountered: