fix(nuxt3): remove workaround for unfulfilled initial navigation (#3436)

* fix(router): remove error workaround

* chore: deduplicate vue-router

* chore: update lockfile

Co-authored-by: Pooya Parsa <pyapar@gmail.com>
This commit is contained in:
Daniel Roe 2022-02-28 19:17:25 +00:00 committed by GitHub
parent fcb200730d
commit 17bf70ae1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 218 additions and 651 deletions

View File

@ -56,7 +56,7 @@
"typescript": "^4.5.5", "typescript": "^4.5.5",
"unbuild": "^0.6.9", "unbuild": "^0.6.9",
"vitest": "^0.5.8", "vitest": "^0.5.8",
"vue-router": "next", "vue-router": "^4.0.13",
"vue-tsc": "^0.32.0" "vue-tsc": "^0.32.0"
}, },
"engines": { "engines": {

View File

@ -96,11 +96,9 @@ export default defineNuxtPlugin((nuxtApp) => {
const result = await callWithNuxt(nuxtApp as NuxtApp, middleware, [to, from]) const result = await callWithNuxt(nuxtApp as NuxtApp, middleware, [to, from])
if (process.server) { if (process.server) {
if (result === false || result instanceof Error) { if (result === false || result instanceof Error) {
const error = result || createError({ return result || createError({
statusMessage: `Route navigation aborted: ${nuxtApp.ssrContext.url}` statusMessage: `Route navigation aborted: ${nuxtApp.ssrContext.url}`
}) })
nuxtApp.ssrContext.error = error
throw error
} }
} }
if (result || result === false) { return result } if (result || result === false) { return result }

863
yarn.lock

File diff suppressed because it is too large Load Diff