diff --git a/src/client/app/router.ts b/src/client/app/router.ts index 83faca5c..caf36a2d 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -84,11 +84,11 @@ export function createRouter( { smoothScroll = false, initialLoad = false } = {} ) { href = normalizeHref(href) - const loc = inBrowser ? normalizeHref(location.href) : null - if ((await router.onBeforeRouteChange?.(href)) === false) return - if (loc !== null) { + if (inBrowser) { + const loc = normalizeHref(location.href) + const { pathname, hash } = new URL(href, fakeHost) const currentLoc = new URL(loc, fakeHost)