From bd32ccd2d6431a19c868bee8f8d3a5cf45f12186 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 6ab6a32ca..dd43c488a 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] }) }