From a797b3cda245e84b5b2cb58d3873ebb639e74f05 Mon Sep 17 00:00:00 2001 From: Julien Huang Date: Mon, 13 Nov 2023 08:29:44 +0100 Subject: [PATCH] fix(nuxt): fix replace regex used for slots in islands SSR (#24255) --- packages/nuxt/src/core/runtime/nitro/renderer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxt/src/core/runtime/nitro/renderer.ts b/packages/nuxt/src/core/runtime/nitro/renderer.ts index 6ab6a32ca1f7..dd43c488ac17 100644 --- a/packages/nuxt/src/core/runtime/nitro/renderer.ts +++ b/packages/nuxt/src/core/runtime/nitro/renderer.ts @@ -584,7 +584,7 @@ function replaceServerOnlyComponentsSlots (ssrContext: NuxtSSRContext, html: str if (!match) { continue } const [, uid, slot] = match if (!uid || !slot) { continue } - html = html.replace(new RegExp(`
]*>((?!nuxt-ssr-slot-name="${slot}"|nuxt-ssr-component-uid)[\\s\\S])*
]*nuxt-ssr-slot-name="${slot}"[^>]*>`), (full) => { + html = html.replace(new RegExp(`
]*nuxt-ssr-component-uid="${uid}"[^>]*>((?!nuxt-ssr-slot-name="${slot}"|nuxt-ssr-component-uid)[\\s\\S])*
]*nuxt-ssr-slot-name="${slot}"[^>]*>`), (full) => { return full + teleports[key] }) }