Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dominikkrulak opened this issue Oct 14, 2024 · 0 comments

Comments

@dominikkrulak
Copy link

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 dominikkrulak changed the title Uncaught HierarchyRequestError: Failed to execute 'appendChild' on 'Node': This node type does not support this method.(hydration: true) Uncaught HierarchyRequestError: Failed to execute 'appendChild' on 'Node': This node type does not support this method.{hydration: true} Oct 14, 2024
@dominikkrulak dominikkrulak changed the title Uncaught HierarchyRequestError: Failed to execute 'appendChild' on 'Node': This node type does not support this method.{hydration: true} Uncaught HierarchyRequestError: Failed to execute 'appendChild' on 'Node': This node type does not support this method. With {hydration: true} Oct 14, 2024
@dominikkrulak dominikkrulak changed the title Uncaught HierarchyRequestError: Failed to execute 'appendChild' on 'Node': This node type does not support this method. With {hydration: true} Uncaught HierarchyRequestError: Failed to execute 'appendChild' on 'Node': This node type does not support this method. ({hydration: true}) Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant