Title: Server side router navigation with changes to query parameters not sending a redirect response · Issue #31482 · angular/angular-cli · GitHub
Open Graph Title: Server side router navigation with changes to query parameters not sending a redirect response · Issue #31482 · angular/angular-cli
X Title: Server side router navigation with changes to query parameters not sending a redirect response · Issue #31482 · angular/angular-cli
Description: Command run Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description When pushing a new navigation on server side only with: await th...
Open Graph Description: Command run Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description When pushing a new navig...
X Description: Command run Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description When pushing a new navig...
Opengraph URL: https://github.com/angular/angular-cli/issues/31482
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Server side router navigation with changes to query parameters not sending a redirect response","articleBody":"### Command\n\nrun\n\n### Is this a regression?\n\n- [ ] Yes, this behavior used to work in the previous version\n\n### The previous version in which this bug was not present was\n\n_No response_\n\n### Description\n\nWhen pushing a new navigation on server side only with:\n```ts\nawait this.router.navigate([], {\n queryParams: {filter: 'test'},\n queryParamsHandling: 'merge', // remove to replace all query params by provided\n relativeTo: route\n});\n```\nThis does not result in a redirect response being sent to the browser, just a regular 200.\n\nIt seems like, in the [check for whether the url change](https://github.com/angular/angular-cli/blob/main/packages/angular/ssr/src/utils/ng.ts#L113), the query parameters on finalUrl and initialUrl of the lastSuccessfulNavigation object are the same, which they shouldn't!\n\n### Minimal Reproduction\n\nReproduction code: https://github.com/WizzardMaker/angular-ssr-navigate-bug\n\nSteps to reproduce in the project:\n1. Navigate to e.g. ´/?filter=a´\n2. See that server response is of status code 200, not any other redirect code\n\nIn short what the project does:\nA route component triggers a router navigation in it's constructor like this:\n```ts\nif(isPlatformBrowser(inject(PLATFORM_ID))) return;\n\nthis.pendingTasks.run(async () => {\n await this.router.navigate([], {\n queryParams: {filter: 'test'},\n queryParamsHandling: 'merge', // remove to replace all query params by provided\n relativeTo: route\n })\n})\n```\n\n### Exception or Error\n\n```text\n\n```\n\n### Your Environment\n\n```text\n_ _ ____ _ ___\n / \\ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|\n / △ \\ | '_ \\ / _` | | | | |/ _` | '__| | | | | | |\n / ___ \\| | | | (_| | |_| | | (_| | | | |___| |___ | |\n /_/ \\_\\_| |_|\\__, |\\__,_|_|\\__,_|_| \\____|_____|___|\n |___/\n \n\n\nAngular CLI: 20.3.5\nNode: 24.9.0\nPackage Manager: npm 11.6.0\nOS: darwin arm64\n \n\nAngular: 20.3.4\n... common, compiler, compiler-cli, core, forms\n... platform-browser, platform-server, router\n\nPackage Version\n------------------------------------\n@angular-devkit/architect 0.2003.5\n@angular-devkit/core 20.3.5\n@angular-devkit/schematics 20.3.5\n@angular/build 20.3.5\n@angular/cli 20.3.5\n@angular/ssr 20.3.5\n@schematics/angular 20.3.5\nrxjs 7.8.2\ntypescript 5.9.3\n```\n\n### Anything else relevant?\n\nThis happens only on server side rendering on a standard node server and on ng serve. I don't quite know whether this behaviour changed between versions","author":{"url":"https://github.com/WizzardMaker","@type":"Person","name":"WizzardMaker"},"datePublished":"2025-10-15T12:56:42Z","url":"https://github.com/angular/angular-cli/issues/31482"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:40f2b3c4-ab55-2efe-27da-9c640abf31c0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D6B0:2E3BCE:5C765:838EC:6AFDD64C |
| html-safe-nonce | 0fd7f0194d165341ec49d04c1ff628110b562c07388e84ad7a3cbf4398611f2b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENkIwOjJFM0JDRTo1Qzc2NTo4MzhFQzo2QUZERDY0QyIsInZpc2l0b3JfaWQiOiI4MTExMTQxMDYyNzk1MTg3Nzg4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 47c7bd95928ca91fc1492e2d0fec1f767b3534f2617e8c1d9082f324c4321a88 |
| hovercard-subject-tag | issue:3517926368 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/31482/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b33349de950a81647f1d6b19e8bc7cdb4bea6fb68a4a25a5bcda1000fcc2f777/angular/angular-cli/issues/31482 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b33349de950a81647f1d6b19e8bc7cdb4bea6fb68a4a25a5bcda1000fcc2f777/angular/angular-cli/issues/31482 |
| og:image:alt | Command run Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description When pushing a new navig... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | WizzardMaker |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9918bd4004419458bcd838065ac2a76b76ebd11705d73909fff5ab99e996fa23 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a231c174493a6a442c0b0544475c918b30128208 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width