Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular 19 SSR nested redirectTo result in a redirect loop #28903

Closed
ManuelRauber opened this issue Nov 20, 2024 · 0 comments · Fixed by #28906
Closed

Angular 19 SSR nested redirectTo result in a redirect loop #28903

ManuelRauber opened this issue Nov 20, 2024 · 0 comments · Fixed by #28906
Assignees
Labels
area: @angular/ssr freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix

Comments

@ManuelRauber
Copy link

ManuelRauber commented Nov 20, 2024

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

router

Is this a regression?

Yes

Description

Using the following routes in Angular 19 with SSR enables leads to an ERR_TOO_MANY_REDIRECTS error:

export const routes: Routes = [
  {
    path: '',
    pathMatch: 'full',
    redirectTo: 'some',
  },
  {
    path: ':param',
    children: [
      {
        path: '',
        pathMatch: 'full',
        redirectTo: 'thing',
      },
      {
        path: 'thing',
        component: ExampleComponent,
      }
    ]
  }
];

The behavior in Angular 18 SSR: If you go to / you're redirected to /some which redirects to /some/thing.
The behavior in Angular 19 SSR: If you go to / you get stuck in a redirect loop which tries to redirect to /thing. So, it looks like the nested redirect is not adding the parent route but tries redirect to a root route.

The same routing works in Angular 19 without SSR.

Please see the linked example and read the README there for setting up the example.

Please provide a link to a minimal reproduction of the bug

https://github.com/ManuelRauber/angular-19-ssr-redirect-issue

Please provide the exception or error you saw

`ERR_TOO_MANY_REDIRECTS` in the browser.

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

Angular CLI: 19.0.0
Node: 20.17.0
Package Manager: npm 10.8.2
OS: darwin arm64

Angular: 19.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router, ssr

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1900.0
@angular-devkit/build-angular   19.0.0
@angular-devkit/core            19.0.0
@angular-devkit/schematics      19.0.0
@schematics/angular             19.0.0
rxjs                            7.8.1
typescript                      5.6.3
zone.js                         0.15.0

Anything else?

No response

@ManuelRauber ManuelRauber changed the title Angular 19 SSR multiple redirectTo result in a redirect loop Angular 19 SSR nested redirectTo result in a redirect loop Nov 20, 2024
@alan-agius4 alan-agius4 transferred this issue from angular/angular Nov 20, 2024
@alan-agius4 alan-agius4 self-assigned this Nov 20, 2024
@alan-agius4 alan-agius4 added type: bug/fix freq1: low Only reported by a handful of users who observe it rarely severity3: broken area: @angular/ssr labels Nov 20, 2024
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 20, 2024
…router config

This commit ensures proper handling of nested redirects that are implicitly structured but not explicitly defined in the router configuration.

Closes angular#28903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 20, 2024
…router config

This commit ensures proper handling of nested redirects that are implicitly structured but not explicitly defined in the router configuration.

Closes angular#28903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 20, 2024
…router config

This commit ensures proper handling of nested redirects that are implicitly structured but not explicitly defined in the router configuration.

Closes angular#28903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 20, 2024
…router config

This commit ensures proper handling of nested redirects that are implicitly structured but not explicitly defined in the router configuration.

Closes angular#28903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 20, 2024
…router config

This commit ensures proper handling of nested redirects that are implicitly structured but not explicitly defined in the router configuration.

Closes angular#28903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 21, 2024
…router config

This commit ensures proper handling of nested redirects that are implicitly structured but not explicitly defined in the router configuration.

Closes angular#28903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 21, 2024
…router config

This commit ensures proper handling of nested redirects that are implicitly structured but not explicitly defined in the router configuration.

Closes angular#28903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 21, 2024
…router config

This commit ensures proper handling of nested redirects that are implicitly structured but not explicitly defined in the router configuration.

Closes angular#28903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 21, 2024
…router config

This commit ensures proper handling of nested redirects that are implicitly structured but not explicitly defined in the router configuration.

Closes angular#28903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 21, 2024
…router config

This commit ensures proper handling of nested redirects that are implicitly structured but not explicitly defined in the router configuration.

Closes angular#28903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 21, 2024
…router config

This commit ensures proper handling of nested redirects that are implicitly structured but not explicitly defined in the router configuration.

Closes angular#28903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 21, 2024
…router config

This commit ensures proper handling of nested redirects that are implicitly structured but not explicitly defined in the router configuration.

Closes angular#28903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 21, 2024
…router config

This commit ensures proper handling of nested redirects that are implicitly structured but not explicitly defined in the router configuration.

Closes angular#28903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 21, 2024
…router config

This commit ensures proper handling of nested redirects that are implicitly structured but not explicitly defined in the router configuration.

Closes angular#28903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 22, 2024
…router config

This commit ensures proper handling of nested redirects that are implicitly structured but not explicitly defined in the router configuration.

Closes angular#28903
alan-agius4 added a commit that referenced this issue Nov 22, 2024
…router config

This commit ensures proper handling of nested redirects that are implicitly structured but not explicitly defined in the router configuration.

Closes #28903
alan-agius4 added a commit that referenced this issue Nov 22, 2024
…router config

This commit ensures proper handling of nested redirects that are implicitly structured but not explicitly defined in the router configuration.

Closes #28903

(cherry picked from commit 34574b2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: @angular/ssr freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
2 participants