-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Can't specify allowed hosts in ng serve #64104
Copy link
Copy link
Closed
Labels
area: docsRelated to the documentationRelated to the documentationgood first issueLabel noting a good first issue to be worked on by a community memberLabel noting a good first issue to be worked on by a community memberopen for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).An issue that is suitable for a community contributor (based on its complexity/scope).
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
area: docsRelated to the documentationRelated to the documentationgood first issueLabel noting a good first issue to be worked on by a community memberLabel noting a good first issue to be worked on by a community memberopen for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).An issue that is suitable for a community contributor (based on its complexity/scope).
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