fix(nuxt): allow island renders without / route (#20894)

This commit is contained in:
Daniel Roe 2023-05-16 22:50:55 +01:00 committed by GitHub
parent e3af77253d
commit 53bd8a44ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -186,7 +186,7 @@ const plugin: Plugin<{ router: Router }> = defineNuxtPlugin({
if (process.server && failure?.type === 4 /* ErrorTypes.NAVIGATION_ABORTED */) {
return
}
if (to.matched.length === 0) {
if (to.matched.length === 0 && (!process.server || !nuxtApp.ssrContext?.islandContext)) {
await nuxtApp.runWithContext(() => showError(createError({
statusCode: 404,
fatal: false,