Custom builders: Can no longer use an option called "target" with "enum" restriction #24511
Open
1 task done
Labels
area: angular/cli
freq1: low
Only reported by a handful of users who observe it rarely
severity3: broken
type: bug/fix


Command
other
Is this a regression?
The previous version in which this bug was not present was
13.3.9
Description
When writing custom Angular builders I was able to specify a builder option with the name
targetthat used theenumproperty in the builder'sschema.jsonfile. Starting with Angular 14 this changed. Now, I can still specify an option with this name in my builder's schema, but it must not have anenumproperty. Otherwise, the builder fails in what seems to be theyargsvalidation in theangular-cli'scommand-runner. Note that there is also other unexpected behavior when using a type ofbooleanfor thetargetoption, which throws a seemingly unrelated error.I wasn't able to find anything regarding this in the changelog of
angularorangular-cli, so it seems like it's an accidental breaking change. Instead of renaming the option in our builder(s), we figured out that it's enough to just remove theenumproperty from theschema.json, but eventually, it would be nice to be able to useenumagain.Minimal Reproduction
I prepared a reproduction repository here. Follow the "Quick start" section in the README.md file to reproduce the error locally.
Exception or Error
No response
Your Environment
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: