fix(nuxt): throw hard error on initial spa load if aborted (#6857)

This commit is contained in:
Daniel Roe 2022-08-23 09:42:54 +01:00 committed by GitHub
parent 347df12e9a
commit aab90efc19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -143,7 +143,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
} }
const result = await callWithNuxt(nuxtApp, middleware, [to, from]) const result = await callWithNuxt(nuxtApp, middleware, [to, from])
if (process.server) { if (process.server || (!nuxtApp.payload.serverRendered && nuxtApp.isHydrating)) {
if (result === false || result instanceof Error) { if (result === false || result instanceof Error) {
const error = result || createError({ const error = result || createError({
statusMessage: `Route navigation aborted: ${initialURL}` statusMessage: `Route navigation aborted: ${initialURL}`