When using Angular with SSR without prerender there is no index.html generated #28574
Labels
area: @schematics/angular
freq1: low
Only reported by a handful of users who observe it rarely
severity3: broken
type: bug/fix
Command
build
Is this a regression?
The previous version in which this bug was not present was
Description
I am using Angular 18 with @angular/pwa
Inside
ngsw-config.json
, inside the assets group, you can find the initialapp
group.By default, the content of the asset group is the following
If you use Angular with SSR and prefetch false, you will not get the
index.html
file in the dist folder. You will only get theindex.csr.html
This seems like a bug.
I observed that suddenly we always make a request for the index.html bypassing the advantage of having it cached by the SW.
https://angular.dev/guide/ssr#using-angular-service-worker
Minimal Reproduction
ng new prototype
ng add @angular/pwa
change the prerender to false
ng build
node dist/prototype/server/server.mjs
Exception or Error
No response
Your Environment
Angular CLI: 18.2.7
Node: 22.5.1
Package Manager: npm 10.8.2
OS: win32 x64
Angular: 18.2.7
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router, service-worker, ssr
Package Version
@angular-devkit/architect 0.1802.7
@angular-devkit/build-angular 18.2.7
@angular-devkit/core 18.2.7
@angular-devkit/schematics 18.2.7
@schematics/angular 18.2.7
rxjs 7.8.1
typescript 5.5.4
zone.js 0.14.10
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: