diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index b36e48ce41..302db34a25 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -59,7 +59,7 @@ "pathe": "^0.3.0", "perfect-debounce": "^0.1.3", "scule": "^0.2.1", - "ufo": "^0.8.3", + "ufo": "^0.8.4", "unctx": "^1.1.4", "unenv": "^0.5.1", "unimport": "^0.1.8", diff --git a/packages/nuxt/src/app/plugins/router.ts b/packages/nuxt/src/app/plugins/router.ts index 0dc9661344..84b85dbd6c 100644 --- a/packages/nuxt/src/app/plugins/router.ts +++ b/packages/nuxt/src/app/plugins/router.ts @@ -1,5 +1,5 @@ import { reactive, h } from 'vue' -import { parseURL, parseQuery, withoutBase } from 'ufo' +import { parseURL, parseQuery, withoutBase, isEqual } from 'ufo' import { createError } from 'h3' import { defineNuxtPlugin } from '..' import { callWithNuxt } from '../nuxt' @@ -221,7 +221,7 @@ export default defineNuxtPlugin<{ route: Route, router: Router }>((nuxtApp) => { }) await router.replace(initialURL) - if (route.fullPath !== initialURL) { + if (!isEqual(route.fullPath, initialURL)) { await callWithNuxt(nuxtApp, navigateTo, [route.fullPath]) } }) diff --git a/packages/nuxt/src/pages/runtime/router.ts b/packages/nuxt/src/pages/runtime/router.ts index e63ebb05ac..5fa4819e5e 100644 --- a/packages/nuxt/src/pages/runtime/router.ts +++ b/packages/nuxt/src/pages/runtime/router.ts @@ -7,7 +7,7 @@ import { RouteLocation } from 'vue-router' import { createError } from 'h3' -import { withoutBase } from 'ufo' +import { withoutBase, isEqual } from 'ufo' import NuxtPage from './page' import { callWithNuxt, defineNuxtPlugin, useRuntimeConfig, throwError, clearError, navigateTo, useError } from '#app' // @ts-ignore @@ -177,7 +177,7 @@ export default defineNuxtPlugin(async (nuxtApp) => { if (process.server) { const currentURL = to.fullPath || '/' - if (currentURL !== initialURL) { + if (!isEqual(currentURL, initialURL)) { await callWithNuxt(nuxtApp, navigateTo, [currentURL]) } } diff --git a/packages/schema/package.json b/packages/schema/package.json index b62c1701d1..8cac941ac0 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -27,7 +27,7 @@ "postcss-import-resolver": "^2.0.0", "scule": "^0.2.1", "std-env": "^3.1.1", - "ufo": "^0.8.3", + "ufo": "^0.8.4", "unimport": "^0.1.8" }, "engines": { diff --git a/packages/vite/package.json b/packages/vite/package.json index 0cdc99c4ce..6102ae59e8 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -42,7 +42,7 @@ "postcss-url": "^10.1.3", "rollup": "^2.72.0", "rollup-plugin-visualizer": "^5.6.0", - "ufo": "^0.8.3", + "ufo": "^0.8.4", "unplugin": "^0.6.2", "vite": "^2.9.8", "vite-node": "^0.10.5", diff --git a/packages/webpack/package.json b/packages/webpack/package.json index 59ea9569c9..c00e52c564 100644 --- a/packages/webpack/package.json +++ b/packages/webpack/package.json @@ -42,7 +42,7 @@ "postcss-url": "^10.1.3", "style-resources-loader": "^1.5.0", "time-fix-plugin": "^2.0.7", - "ufo": "^0.8.3", + "ufo": "^0.8.4", "unplugin": "^0.6.2", "url-loader": "^4.1.1", "vue-loader": "^17.0.0", diff --git a/yarn.lock b/yarn.lock index 5a0663ca06..9e2766dde5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1537,7 +1537,7 @@ __metadata: postcss-import-resolver: ^2.0.0 scule: ^0.2.1 std-env: ^3.1.1 - ufo: ^0.8.3 + ufo: ^0.8.4 unbuild: latest unimport: ^0.1.8 languageName: unknown @@ -1651,7 +1651,7 @@ __metadata: postcss-url: ^10.1.3 rollup: ^2.72.0 rollup-plugin-visualizer: ^5.6.0 - ufo: ^0.8.3 + ufo: ^0.8.4 unbuild: latest unplugin: ^0.6.2 vite: ^2.9.8 @@ -1699,7 +1699,7 @@ __metadata: postcss-url: ^10.1.3 style-resources-loader: ^1.5.0 time-fix-plugin: ^2.0.7 - ufo: ^0.8.3 + ufo: ^0.8.4 unbuild: latest unplugin: ^0.6.2 url-loader: ^4.1.1 @@ -10081,7 +10081,7 @@ __metadata: pathe: ^0.3.0 perfect-debounce: ^0.1.3 scule: ^0.2.1 - ufo: ^0.8.3 + ufo: ^0.8.4 unbuild: latest unctx: ^1.1.4 unenv: ^0.5.1 @@ -13231,10 +13231,10 @@ __metadata: languageName: node linkType: hard -"ufo@npm:^0.8.3": - version: 0.8.3 - resolution: "ufo@npm:0.8.3" - checksum: 7ea20e9d0fbd92b3310de4b020919f0a0542db60a6787ccecf232285d55795ddc0ea482b04d6c07cac60367a294aee705d888999867a5c3c69e47ed8d0ae3009 +"ufo@npm:^0.8.3, ufo@npm:^0.8.4": + version: 0.8.4 + resolution: "ufo@npm:0.8.4" + checksum: a2ebef6f64b9cc4114fc65405837eeb83eb8975edd6d54c7f37abb6905da6fd1f63524e4a02c8b087e7b0b3db6e6f4f798a3d86a96500410ff590b405f807dc9 languageName: node linkType: hard