mikado icon indicating copy to clipboard operation
mikado copied to clipboard

Uncaught HierarchyRequestError: Failed to execute 'appendChild' on 'Node': This node type does not support this method. (`{hydration: true}`)

Open dominikkrulak opened this issue 4 months ago • 0 comments

index.html

<div id="hydrate">
        <!--Template start-->
	<div>Text node<div>Custom label</div></div>
</div>

test.html

<div id="{{ data.id }}"><div>{{ data.label }}</div></div>

test.js

const data = {id: 'x', label: 'new Label'};
const root = document.getElementById("hydrate");
const view = new Mikado(testTemplate, { root: root, hydrate: true });
view.render(data);

The title of this issue speaks for itself. With the hydration on, I get this error logged in my console. Looks like hydration matched the structure, but failed to append Node to the textNode. If the Node is type of textNode the appendChild method fails.

Hm, I should fork this repository to see what's going on...

dominikkrulak avatar Oct 14 '24 10:10 dominikkrulak