N
Nuxt2y ago
acidjazz

layout logic failing

<doc-menu v-if="useRoute().name === 'doc-article'">
<slot />
</doc-menu>
<slot v-else />
<doc-menu v-if="useRoute().name === 'doc-article'">
<slot />
</doc-menu>
<slot v-else />
this generates JS errors and fires off the page vue component twice Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
3 Replies
manniL
manniL2y ago
Hey! When the layout is rendered, it does not have knowledge about the route yet (on the server). But when the state is serialized, the route is known Thus, the client will render it „as wanted“ but the server doesn’t ~> mismatch
acidjazz
acidjazz2y ago
thanks @manniL / TheAlexLichter !
manniL
manniL2y ago
np! 🙂
Want results from more Discord servers?
Add your server