diff --git a/src/compiler/compile/Component.ts b/src/compiler/compile/Component.ts index 56d49fc1755a..5c89938f9407 100644 --- a/src/compiler/compile/Component.ts +++ b/src/compiler/compile/Component.ts @@ -107,7 +107,7 @@ export default class Component { slots: Map = new Map(); slot_outlets: Set = new Set(); - tags: Tag[] = [] + tags: Tag[] = []; constructor( ast: Ast, diff --git a/src/compiler/compile/nodes/Element.ts b/src/compiler/compile/nodes/Element.ts index 30c5ec2e3bf3..4058972157bb 100644 --- a/src/compiler/compile/nodes/Element.ts +++ b/src/compiler/compile/nodes/Element.ts @@ -379,6 +379,7 @@ export default class Element extends Node { this.handlers.length > 0 || this.styles.length > 0 || this.name === 'option' || + this.is_dynamic_element || this.tag_expr.dynamic_dependencies().length || component.compile_options.dev ) { diff --git a/src/compiler/compile/render_ssr/handlers/Element.ts b/src/compiler/compile/render_ssr/handlers/Element.ts index a752a3c9f7e5..4f1c7931848d 100644 --- a/src/compiler/compile/render_ssr/handlers/Element.ts +++ b/src/compiler/compile/render_ssr/handlers/Element.ts @@ -159,9 +159,7 @@ export default function (node: Element, renderer: Renderer, options: RenderOptio }); if (options.hydratable) { - if (options.head_id) { - renderer.add_string(` data-svelte="${options.head_id}"`); - } else if (node.children.length === 1 && node.children[0].type === 'RawMustacheTag') { + if (node.children.length === 1 && node.children[0].type === 'RawMustacheTag') { renderer.add_string(` data-svelte="${hash(JSON.stringify(node.children[0].expression.node))}"`); options = { ...options, optimised_html_hydration: true }; } else if (node.can_optimise_to_html_string && !options.has_added_svelte_hash) {