Title: withHashLocation is not compatible with SSR (throws TypeError: Invalid URL when parsing "#/") · Issue #68322 · angular/angular · GitHub
Open Graph Title: withHashLocation is not compatible with SSR (throws TypeError: Invalid URL when parsing "#/") · Issue #68322 · angular/angular
X Title: withHashLocation is not compatible with SSR (throws TypeError: Invalid URL when parsing "#/") · Issue #68322 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? router Is this a regression? Yes Description When the withHashLocation feature is used under SSR, the build will hang after throwing an exception. Please provide a link to a minimal ...
Open Graph Description: Which @angular/* package(s) are the source of the bug? router Is this a regression? Yes Description When the withHashLocation feature is used under SSR, the build will hang after throwing an except...
X Description: Which @angular/* package(s) are the source of the bug? router Is this a regression? Yes Description When the withHashLocation feature is used under SSR, the build will hang after throwing an except...
Opengraph URL: https://github.com/angular/angular/issues/68322
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"withHashLocation is not compatible with SSR (throws TypeError: Invalid URL when parsing \"#/\")","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\nrouter\n\n### Is this a regression?\n\nYes\n\n### Description\n\nWhen the `withHashLocation` feature is used under SSR, the build will hang after throwing an exception.\n\n### Please provide a link to a minimal reproduction of the bug\n\nhttps://github.com/eblocha/ng-ssr-hash-routing\n\n### Please provide the exception or error you saw\n\n```true\nERROR TypeError: Invalid URL\n at new URL (node:internal/url:819:25)\n at HD (file:///Users/elliot.blocha/projects/scratch/ssr-test/.angular/prerender-root/fa99184b-c1cb-46ed-80af-134e4ceff1a7/main.server.mjs:40:31721)\n at e.replaceState (file:///Users/elliot.blocha/projects/scratch/ssr-test/.angular/prerender-root/fa99184b-c1cb-46ed-80af-134e4ceff1a7/main.server.mjs:40:32574)\n at e.replaceState (file:///Users/elliot.blocha/projects/scratch/ssr-test/.angular/prerender-root/fa99184b-c1cb-46ed-80af-134e4ceff1a7/main.server.mjs:31:54829)\n at e.replaceState (file:///Users/elliot.blocha/projects/scratch/ssr-test/.angular/prerender-root/fa99184b-c1cb-46ed-80af-134e4ceff1a7/main.server.mjs:31:52733)\n at e.setBrowserUrl (file:///Users/elliot.blocha/projects/scratch/ssr-test/.angular/prerender-root/fa99184b-c1cb-46ed-80af-134e4ceff1a7/main.server.mjs:40:95885)\n at e.handleRouterEvent (file:///Users/elliot.blocha/projects/scratch/ssr-test/.angular/prerender-root/fa99184b-c1cb-46ed-80af-134e4ceff1a7/main.server.mjs:40:95478)\n at Object.next (file:///Users/elliot.blocha/projects/scratch/ssr-test/.angular/prerender-root/fa99184b-c1cb-46ed-80af-134e4ceff1a7/main.server.mjs:40:98624)\n at uf.next (file:///Users/elliot.blocha/projects/scratch/ssr-test/.angular/prerender-root/fa99184b-c1cb-46ed-80af-134e4ceff1a7/main.server.mjs:4:3112)\n at ao._next (file:///Users/elliot.blocha/projects/scratch/ssr-test/.angular/prerender-root/fa99184b-c1cb-46ed-80af-134e4ceff1a7/main.server.mjs:4:2795) {\n code: 'ERR_INVALID_URL',\n input: '#/'\n```\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\nAngular CLI : 21.2.7\nAngular : 21.2.9\nNode.js : 24.15.0\nPackage Manager : npm 11.12.1\nOperating System : darwin arm64\n\n┌───────────────────────────┬───────────────────┬───────────────────┐\n│ Package │ Installed Version │ Requested Version │\n├───────────────────────────┼───────────────────┼───────────────────┤\n│ @angular/build │ 21.2.7 │ ^21.2.7 │\n│ @angular/cli │ 21.2.7 │ ^21.2.7 │\n│ @angular/common │ 21.2.9 │ ^21.2.9 │\n│ @angular/compiler │ 21.2.9 │ ^21.2.9 │\n│ @angular/compiler-cli │ 21.2.9 │ ^21.2.9 │\n│ @angular/core │ 21.2.9 │ ^21.2.9 │\n│ @angular/forms │ 21.2.9 │ ^21.2.9 │\n│ @angular/platform-browser │ 21.2.9 │ ^21.2.9 │\n│ @angular/platform-server │ 21.2.9 │ ^21.2.9 │\n│ @angular/router │ 21.2.9 │ ^21.2.9 │\n│ @angular/ssr │ 21.2.7 │ ^21.2.7 │\n│ rxjs │ 7.8.2 │ ~7.8.0 │\n│ typescript │ 5.9.3 │ ~5.9.2 │\n│ vitest │ 4.1.0 │ ^4.0.8 │\n└───────────────────────────┴───────────────────┴───────────────────┘\n```\n\n### Anything else?\n\n_No response_","author":{"url":"https://github.com/eblocha","@type":"Person","name":"eblocha"},"datePublished":"2026-04-21T15:50:18Z","url":"https://github.com/angular/angular/issues/68322"}
| 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:4823fecf-0c8b-45d8-e5d7-9869ee4dedb7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EE04:3524E1:C10CD:114385:6AFDCCBD |
| html-safe-nonce | 539fcc673b744b2114ddd5fcdcc485966f932c26e1e7a4e7825a779a31bd4383 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRTA0OjM1MjRFMTpDMTBDRDoxMTQzODU6NkFGRENDQkQiLCJ2aXNpdG9yX2lkIjoiODI3NDgxMDIwNjE3NzU3ODE3MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f63281aa0910293237b759a71a8b88f09fa516ff2b57ffde47e3dd77f8850a13 |
| hovercard-subject-tag | issue:4307286790 |
| 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/68322/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5f5edcab0b65506d114244fc513af34917a7d253d4239ed237a126f80b1831b9/angular/angular/issues/68322 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5f5edcab0b65506d114244fc513af34917a7d253d4239ed237a126f80b1831b9/angular/angular/issues/68322 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? router Is this a regression? Yes Description When the withHashLocation feature is used under SSR, the build will hang after throwing an except... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | eblocha |
| hostname | github.com |
| expected-hostname | github.com |
| None | 26886a40b582b821a7a76351e0a2f42b6d6160854b6e2520db24f31fd7be5da7 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| 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 | 68ebaa631a1d248d69ebde4b9c5defd3a19aeb2f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width