Command
serve
Is this a regression?
The previous version in which this bug was not present was
No response
Description
Following the vite documentation, I should be able to give specific allowed hosts, as a string array. In the Angular documentation, it does not seem to be possible because the option value type is only boolean. Hoping the documentation would be lying, I tried to specify a string array. It does not work, I get this error:
➜ app git:(main) ng serve --allowed-hosts my.host1.com
Error: Invalid values:
Argument: project, Given: "my.host1.com", Choices: "app"
I should be able to specify a given array of hosts to ng serve, since it is indeed an option in the vite documentation.
Minimal Reproduction
To reproduce the issue, you can just create a new app using ng new and try the command ng serve --allowed-hosts my.host1.com. Here is the app I tried it on: https://github.com/Lysoun/angular-ng-serve-allowed-hosts
Exception or Error
Error: Invalid values:
Argument: project, Given: "my.host1.com", Choices: "app"
Your Environment
Angular CLI: 20.3.3
Node: 22.16.0
Package Manager: npm 10.9.2
OS: darwin arm64
Angular: 20.3.2
... common, compiler, compiler-cli, core, forms
... platform-browser, router
Package Version
------------------------------------
@angular-devkit/architect 0.2003.3
@angular-devkit/core 20.3.3
@angular-devkit/schematics 20.3.3
@angular/build 20.3.3
@angular/cli 20.3.3
@schematics/angular 20.3.3
rxjs 7.8.2
typescript 5.9.2
zone.js 0.15.1
Anything else relevant?
No response
Command
serve
Is this a regression?
The previous version in which this bug was not present was
No response
Description
Following the vite documentation, I should be able to give specific allowed hosts, as a string array. In the Angular documentation, it does not seem to be possible because the option value type is only boolean. Hoping the documentation would be lying, I tried to specify a string array. It does not work, I get this error:
I should be able to specify a given array of hosts to
ng serve, since it is indeed an option in the vite documentation.Minimal Reproduction
To reproduce the issue, you can just create a new app using
ng newand try the commandng serve --allowed-hosts my.host1.com. Here is the app I tried it on: https://github.com/Lysoun/angular-ng-serve-allowed-hostsException or Error
Your Environment
Anything else relevant?
No response