GeezerVison is showing github.com — Angular SSR Setup denies accepting matrix params · Issue #31457 · angular/angular-cli
Angular SSR Setup denies accepting matrix params #31457DescriptionWhich @angular/* package(s) are the source of the bug?
@angular/ssr
Is this a regression?
Yes
Description
Angular SSR seems not to accept matrix params in URLs.
Reproduction: App with SSR; then add Matrix params to the URL through the use of angulars routerLink like <a [routerLink]="['.', {foo:'bar'}]">...</a> - when clicked in running angular app it will work as expected since it runs only in the browser.
when trying to request this new url with matrix params from the running ssr server it will fail because of those matrix params.
/home --> works
/home;foo=bar --> not working
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/angular-ssr-matrix-params-denial
Please provide the exception or error you saw
`404 - Not Found`
-- if there is a redirect configured with `**` in the angular `Routes` it would return a 302 to given route.
Please provide the environment you discovered this bug in (run ng version)
Angular CLI: 20.3.5
Node: 20.19.1
Package Manager: npm 10.8.2
OS: linux x64
Angular: 20.3.4
... common, compiler, compiler-cli, core, platform-browser
... platform-server, router
Package Version
------------------------------------
@angular-devkit/architect 0.2003.5
@angular-devkit/core 20.3.5
@angular-devkit/schematics 20.3.5
@angular/build 20.3.5
@angular/cli 20.3.5
@angular/ssr 20.3.5
@schematics/angular 20.3.5
rxjs 7.8.2
typescript 5.9.3
Anything else?
When changing the route definition from using path to matcher function which does essentially the same as the path it works as expected.
{
{
// path: 'home',
matcher: ([s0]) => (s0?.path === 'home' ? { consumed: [s0] } : null),
loadChildren: () => import('./routes/home/home-routes')
}
}Activityalan-agius4 commented on Oct 14, 2025 Hi @mumenthalers, whist I was able to reproduce on stackblitz I wasn't able to do so locally and hence it seems that this is an issue with their server configuration.
$ curl http://localhost:4200/home\;foo\=bar
<!DOCTYPE html><html lang="en"><head>
<script type="module" src="/@vite/client"></script>
<title>Demo: SSR Matrix Params Denial</title>
<meta charset="UTF-8">
<base href="/">
</head>
<body>
<app-root ng-version="20.3.4" ng-server-context="ssr"><router-outlet></router-outlet><app-home><h2>home works!</h2><h3>Route Params:</h3><pre>{
"foo": "bar"
}</pre><a href="/home;foo=bar">add some matrix params</a><hr><button>browser refresh</button><router-outlet></router-outlet><!--container--></app-home><!--container--></app-root>
<script src="main.js" type="module"></script>
<link rel="modulepreload" href="home-routes-H6C3XXJA.js">
mumenthalers commented on Oct 14, 2025 @alan-agius4 is it possible you tested with my workaround enabled?
I only used stackblitz to reproduce it with minimal setup but of course experienced it first locally.
I just downloaded the project from stackblitz, run npm ci then npm start and then executed your curl command and got the error.
Could you please look into it again?
Locally I'm running it with:
Angular CLI: 20.3.5
Node: 22.19.0
Package Manager: npm 10.9.3
OS: darwin arm64
alan-agius4 commented on Oct 14, 2025 mumenthalers commented on Oct 14, 2025 @alan-agius4 but it does not work when using the path. What am I missing?
 alan-agius4 commented on Oct 14, 2025 Oh, I know see what you mean. Reacted by Simon Mumenthaler added a commit that references this issue on Oct 15, 2025This issue will close once commit 912cc89 is merged into the 'main' branch.912cc89 added 2 commits that reference this issue on Oct 16, 2025This issue will close once commit 85c18b4 is merged into the 'main' branch.85c18b4 This issue will close once commit 3a28fb6 is merged into the 'main' branch.3a28fb6 angular-automatic-lock-bot commented on Nov 16, 2025 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.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|