#layout logic failing

4 messages · Page 1 of 1 (latest)

tranquil garnet
#
    <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.

heavy talon
#

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

tranquil garnet
#

thanks @heavy talon !