From cd299b420c310d7587e30dd0c9770ce741850d21 Mon Sep 17 00:00:00 2001 From: nkzawa Date: Mon, 7 Mar 2022 13:32:51 +0700 Subject: [PATCH] use pathNoQueryHash --- packages/next/shared/lib/router/router.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/next/shared/lib/router/router.ts b/packages/next/shared/lib/router/router.ts index 83392b261072..da481f225bcb 100644 --- a/packages/next/shared/lib/router/router.ts +++ b/packages/next/shared/lib/router/router.ts @@ -32,7 +32,6 @@ import { } from '../utils' import { isDynamicRoute } from './utils/is-dynamic' import { parseRelativeUrl } from './utils/parse-relative-url' -import { parseUrl } from './utils/parse-url' import { searchParamsToUrlQuery } from './utils/querystring' import resolveRewrites from './utils/resolve-rewrites' import { getRouteMatcher } from './utils/route-matcher' @@ -1866,7 +1865,7 @@ export default class Router implements BaseRouter { locale: string | undefined isPreview: boolean }): Promise { - const asPathname = parseUrl(options.as).pathname + const asPathname = pathNoQueryHash(options.as) const cleanedAs = delLocale( hasBasePath(asPathname) ? delBasePath(asPathname) : asPathname, options.locale