diff --git a/lib/router/router.js b/lib/router/router.js index b4f95d6f..0c46aa93 100644 --- a/lib/router/router.js +++ b/lib/router/router.js @@ -101,9 +101,11 @@ export default class Router { const { pathname, query } = this const url = window.location.href + // This makes sure we only use pathname + query + hash, to mirror `asPath` coming from the server. + const as = window.location.pathname + window.location.search + window.location.hash this.events.emit('routeChangeStart', url) - const routeInfo = await this.getRouteInfo(route, pathname, query, url) + const routeInfo = await this.getRouteInfo(route, pathname, query, as) const { error } = routeInfo if (error && error.cancelled) {