pull/12335/head
Rich Harris 2 years ago
parent 0c37a4056d
commit a7b658a6d1

@ -11,7 +11,7 @@ import {
import { block, branch, pause_effect, resume_effect } from '../../reactivity/effects.js'; import { block, branch, pause_effect, resume_effect } from '../../reactivity/effects.js';
import { DEV } from 'esm-env'; import { DEV } from 'esm-env';
import { queue_micro_task } from '../task.js'; import { queue_micro_task } from '../task.js';
import { hydrating } from '../hydration.js'; import { hydrate_node, hydrating } from '../hydration.js';
import { mutable_source, set, source } from '../../reactivity/sources.js'; import { mutable_source, set, source } from '../../reactivity/sources.js';
const PENDING = 0; const PENDING = 0;
@ -146,4 +146,8 @@ export function await_block(anchor, get_input, pending_fn, then_fn, catch_fn) {
// teardown function is an easy way to ensure that this is not discarded // teardown function is an easy way to ensure that this is not discarded
return noop; return noop;
}); });
if (hydrating) {
anchor = hydrate_node.nextSibling;
}
} }

@ -228,10 +228,11 @@ export function text(anchor) {
var node = hydrate_node; var node = hydrate_node;
if (!node) { if (node.nodeType !== 3) {
// if an {expression} is empty during SSR, `hydrate_nodes` will be empty. // if an {expression} is empty during SSR, `hydrate_nodes` will be empty.
// we need to insert an empty text node // we need to insert an empty text node
anchor.before((node = empty())); node.before((node = empty()));
set_hydrate_node(node);
} }
assign_nodes(node, node); assign_nodes(node, node);

Loading…
Cancel
Save