From c28fcc7f3cd11da565c849bdfaf634aa83b33d4a Mon Sep 17 00:00:00 2001 From: harlan Date: Wed, 1 Jan 2025 22:02:26 +1100 Subject: [PATCH] fix: avoid normalising paths with app routing hashes Fixes #257 --- packages/core/src/router/util.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/src/router/util.ts b/packages/core/src/router/util.ts index 3690013d..70dbe7da 100644 --- a/packages/core/src/router/util.ts +++ b/packages/core/src/router/util.ts @@ -33,11 +33,12 @@ export function normaliseRoute(url: string): NormalisedRoute { } const $url = new URL(url) + const hash = $url.hash.startsWith('#/') ? $url.hash : '' // make sure we start with a leading slash - const path = `${withLeadingSlash($url.pathname)}${$url.search}` + const path = `${withLeadingSlash($url.pathname)}${hash}${$url.search}` let normalised: Partial = { - id: hashPathName(`${$url.pathname}${$url.search}`), + id: hashPathName(path), url, $url, path,