Answer the question
In order to leave comments, you need to log in
Error "The client-side... DOM tree is not matching server-rendered content." when using v-if="!$apollo.loading". What is the possible reason?
Error when using nuxt-apollo module
client.js:730 [Vue warn]: The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or missing <tbody>. Bailing hydration and performing full client-side render.
// dafault.vue
<template>
<div>
<!-- Если убрать v-if="!$apollo.loading" проблема пропадает -->
<TheHeader v-if="!$apollo.loading" />
</div>
</template>
<script>
import gql from 'graphql-tag';
import TheHeader from '~/components/TheHeader';
export default {
components: {
TheHeader,
},
apollo: {
categories: {
query: gql`
query {
categories {
id
label
url
}
}
`,
update: (data) => data.categories,
},
},
};
</script>
// TheHeader.vue
<template>
<div>header</div>
</template>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question