Command
serve
Is this a regression?
The previous version in which this bug was not present was
19.2.21
Description
Running ng serve on any Angular 19.2.22+ project with prerender: true or ssr: true throws on the first request with Host http://localhost:4200/ is not allowed, making local development impossible without a workaround.
Root cause: 19.2.22 added an unconditional validateAllowedHosts(url, allowedHosts) check inside @angular/platform-server.renderApplication, but @angular/ssr.renderAngular (the only caller reached from AngularServerApp.handleRendering) never passes allowedHosts. The validator receives undefined, builds an empty Set, and rejects every request. Last working version is 19.2.21 (the validator did not exist there yet).
Minimal Reproduction
⏺ Reproducing only requires creating a default SSR project — no extra code or config changes needed.
ng new my-app --ssr --defaults
cd my-app
ng serve
Then visit http://localhost:4200/ and the error throws immediately on first request.
Exception or Error
Host http://localhost:4200/ is not allowed. You can configure `allowedHosts` option.
Your Environment
Angular CLI: 19.2.25
Node: 20.19.4
Package Manager: npm 10.8.2
OS: darwin arm64
Angular: 19.2.22
... common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1902.25
@angular-devkit/build-angular 19.2.25
@angular-devkit/core 19.2.25
@angular-devkit/schematics 19.2.25
@angular/cli 19.2.25
@angular/ssr 19.2.25
@schematics/angular 19.2.25
rxjs 7.8.2
typescript 5.7.3
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
19.2.21
Description
Running
ng serveon any Angular 19.2.22+ project withprerender: trueorssr: truethrows on the first request withHost http://localhost:4200/ is not allowed, making local development impossible without a workaround.Root cause: 19.2.22 added an unconditional
validateAllowedHosts(url, allowedHosts)check inside@angular/platform-server.renderApplication, but@angular/ssr.renderAngular(the only caller reached fromAngularServerApp.handleRendering) never passesallowedHosts. The validator receivesundefined, builds an emptySet, and rejects every request. Last working version is 19.2.21 (the validator did not exist there yet).Minimal Reproduction
⏺ Reproducing only requires creating a default SSR project — no extra code or config changes needed.
ng new my-app --ssr --defaultscd my-appng serveThen visit http://localhost:4200/ and the error throws immediately on first request.
Exception or Error
Your Environment
Anything else relevant?
No response