Repository navigation
404 when SSR encounters slashes in route params #33044
Copy link
Copy link
Closed
Labels
area: @angular/ssrfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity3: brokentype: bug/fix
Description
Which @angular/* package(s) are the source of the bug?
platform-server
Is this a regression?
No
Description
- Have a parametrized route:
{ path: 'user/:name', component: UserProfile }- Use server side rendering on the route.
- Have a router link that puts slash in the
:name:
<a [routerLink]="['/user', 'Bob / Roberts']">Go to Bob / Roberts profile</a>- Follow the link.
Navigation will succeed in client mode and you'll see encoded param in the URL as expected.
But if you reload the page / navigate to this URL directly, you'll get 404.
Please provide a link to a minimal reproduction of the bug
https://github.com/undsoft/angular-ssr-slash-repro
Please provide the environment you discovered this bug in (run ng version)
Angular CLI : 21.2.8
Angular : 21.2.9
Node.js : 24.14.0
Package Manager : pnpm 10.33.0
Operating System : darwin arm64
┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build │ 21.2.8 │ ^21.2.7 │
│ @angular/cli │ 21.2.8 │ ^21.2.7 │
│ @angular/common │ 21.2.9 │ ^21.2.0 │
│ @angular/compiler │ 21.2.9 │ ^21.2.0 │
│ @angular/compiler-cli │ 21.2.9 │ ^21.2.0 │
│ @angular/core │ 21.2.9 │ ^21.2.0 │
│ @angular/forms │ 21.2.9 │ ^21.2.0 │
│ @angular/platform-browser │ 21.2.9 │ ^21.2.0 │
│ @angular/platform-server │ 21.2.9 │ ^21.2.0 │
│ @angular/router │ 21.2.9 │ ^21.2.0 │
│ @angular/ssr │ 21.2.8 │ ^21.2.7 │
│ rxjs │ 7.8.2 │ ~7.8.0 │
│ typescript │ 5.9.3 │ ~5.9.2 │
│ vitest │ 4.1.5 │ ^4.0.8 │
└───────────────────────────┴───────────────────┴───────────────────┘
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: @angular/ssrfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity3: brokentype: bug/fix
Activity
SkyZeroZx commentedon Apr 22, 2026
This might be related to issue angular/angular#68322 and the fix introduced in version 21.2.9 (#68194)Could you try version 21.2.8 to see if the same issue occurs?
undsoft commentedon Apr 22, 2026
There is no 21.2.8 for ssr package, but if I update other packages, the issue persists.
SkyZeroZx commentedon Apr 22, 2026
I didn't quite understand; currently, there's
@angular/ssrversion 21.2.8.On the other hand, this problem also occurs using Angular 21.2.8, which is probably due to something other than the fix (#68194).
This also happens with Angular 21.0.0
fix(@angular/ssr): decode route segments when building and matching r…
fix(@angular/ssr): decode route segments when building and matching r…
fix(@angular/ssr): decode route segments when building and matching r…
angular-automatic-lock-bot commentedon May 29, 2026
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.