diff --git a/packages/svelte/src/internal/client/dom/blocks/svelte-head.js b/packages/svelte/src/internal/client/dom/blocks/svelte-head.js index 4013cdc57f..6fa9762d90 100644 --- a/packages/svelte/src/internal/client/dom/blocks/svelte-head.js +++ b/packages/svelte/src/internal/client/dom/blocks/svelte-head.js @@ -2,7 +2,6 @@ import { hydrate_node, hydrating, set_hydrate_node } from '../hydration.js'; import { empty } from '../operations.js'; import { block } from '../../reactivity/effects.js'; -import { HYDRATION_START } from '../../../../constants.js'; import { HEAD_EFFECT } from '../../constants.js'; /** @@ -35,14 +34,11 @@ export function head(render_fn) { head_anchor = /** @type {TemplateNode} */ (document.head.firstChild); } - while ( - head_anchor.nodeType !== 8 || - /** @type {Comment} */ (head_anchor).data !== HYDRATION_START - ) { + while (head_anchor.nodeType !== 8 || /** @type {Comment} */ (head_anchor).data !== '#head') { head_anchor = /** @type {TemplateNode} */ (head_anchor.nextSibling); } - head_anchor = /** @type {TemplateNode} */ (head_anchor.nextSibling); + head_anchor = set_hydrate_node(/** @type {TemplateNode} */ (head_anchor.nextSibling)); } else { anchor = document.head.appendChild(empty()); } diff --git a/packages/svelte/src/internal/server/index.js b/packages/svelte/src/internal/server/index.js index 97ddc6c3aa..207c82a4b1 100644 --- a/packages/svelte/src/internal/server/index.js +++ b/packages/svelte/src/internal/server/index.js @@ -137,9 +137,9 @@ export function render(component, options = {}) { */ export function head(payload, fn) { const head_payload = payload.head; - payload.head.out += BLOCK_OPEN; + payload.head.out += ''; fn(head_payload); - payload.head.out += BLOCK_CLOSE; + payload.head.out += ''; } /**