From 90da56a03be6e78060c6cfb1b181b1ff8ea724ac Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 19 Apr 2022 15:37:08 +0100 Subject: [PATCH] fix(nuxt3): initialize router with normalized url (#4427) --- packages/nuxt3/src/pages/runtime/router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxt3/src/pages/runtime/router.ts b/packages/nuxt3/src/pages/runtime/router.ts index 26160233a5..fef1d3eeb5 100644 --- a/packages/nuxt3/src/pages/runtime/router.ts +++ b/packages/nuxt3/src/pages/runtime/router.ts @@ -82,7 +82,7 @@ export default defineNuxtPlugin((nuxtApp) => { } // Allows suspending the route object until page navigation completes - const path = process.server ? nuxtApp.ssrContext.req.url : createCurrentLocation(baseURL, window.location) + const path = process.server ? nuxtApp.ssrContext.url : createCurrentLocation(baseURL, window.location) const _activeRoute = shallowRef(router.resolve(path) as RouteLocation) const syncCurrentRoute = () => { _activeRoute.value = router.currentRoute.value } nuxtApp.hook('page:finish', syncCurrentRoute)