From 9863b785eb90c2f8debcb65657e91c6517c4674c Mon Sep 17 00:00:00 2001 From: Kelvin Soh Date: Wed, 6 Sep 2023 23:16:59 +0800 Subject: [PATCH] fix: html tag hydration: regard empty claimed_nodes array as content mismatch. fixes #6832 --- packages/svelte/src/runtime/internal/dom.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/svelte/src/runtime/internal/dom.js b/packages/svelte/src/runtime/internal/dom.js index 18a5d5d2787b..0c3e3037b16a 100644 --- a/packages/svelte/src/runtime/internal/dom.js +++ b/packages/svelte/src/runtime/internal/dom.js @@ -806,6 +806,9 @@ export function claim_html_tag(nodes, is_svg) { n.claim_order = nodes.claim_info.total_claimed; nodes.claim_info.total_claimed += 1; } + if (claimed_nodes.length === 0) { + return new HtmlTagHydration(is_svg); + } return new HtmlTagHydration(is_svg, claimed_nodes); }