Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A redirect in the children of a route generates a blank html page when using SSG #31150

Closed as duplicate of#31064
@divdavem

Description

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

No

Description

Hello,

I am opening this issue because when using redirectTo in the children of a route, when SSG is enabled, Angular generates a blank page for index.html:

// app.routes.ts
export const routes: Routes = [
 {
 path: '',
 component: LayoutComponent,
 children: [
 {
 path: '',
 pathMatch: 'full',
 redirectTo: 'overview',
 },
 {
 path: 'overview',
 component: OverviewComponent,
 },
 ],
 },
];

I was expecting the redirect to produce a <meta http-equiv="refresh"> soft redirect as explained in the documentation.

Steps to reproduce the issue easily:

git clone https://github.com/divdavem/angular-router-bug-ssg-redirect
cd angular-router-bug-ssg-redirect
npm ci
npm run build

Notice that dist/myapp/browser/index.html is empty.

Please provide a link to a minimal reproduction of the bug

https://github.com/divdavem/angular-router-bug-ssg-redirect

Please provide the exception or error you saw

A blank html page is generated instead of the expected `<meta http-equiv="refresh">` soft redirect.

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 20.2.2
Node: 24.7.0
Package Manager: npm 11.5.1
OS: linux x64
 
Angular: 20.2.4
... common, compiler, compiler-cli, core, forms
... platform-browser, platform-server, router
Package Version
------------------------------------
@angular-devkit/architect 0.2002.2
@angular-devkit/core 20.2.2
@angular-devkit/schematics 20.2.2
@angular/build 20.2.2
@angular/cli 20.2.2
@angular/ssr 20.2.2
@schematics/angular 20.2.2
rxjs 7.8.2
typescript 5.9.2

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /