Andath
Andath

Reputation: 22714

Can not use v-img in this case?

I copy/pasted this code to my Nuxt.js app where I use Vuetify into a component file where only <template> tag wraps it:

<v-card>
    <v-container
      fluid
      grid-list-lg
    >
      <v-layout row wrap> 

        <v-flex xs12>
          <v-card color="purple" class="white--text">
            <v-layout row>
              <v-flex xs7>
                <v-card-title primary-title>
                  <div>
                    <div class="headline">Halycon Days</div>
                    <div>Ellie Goulding</div>
                    <div>(2013)</div>
                  </div>
                </v-card-title>
              </v-flex>
              <v-flex xs5>
                <v-img
                  src="https://cdn.vuetifyjs.com/images/cards/halcyon.png"
                  height="125px"
                  contain
                ></v-img>
              </v-flex>
            </v-layout>
            <v-divider light></v-divider>
            <v-card-actions class="pa-3">
              Rate this album
              <v-spacer></v-spacer>
              <v-icon>star_border</v-icon>
              <v-icon>star_border</v-icon>
              <v-icon>star_border</v-icon>
              <v-icon>star_border</v-icon>
              <v-icon>star_border</v-icon>
            </v-card-actions>
          </v-card>
        </v-flex>
      </v-layout>
    </v-container>
  </v-card>

But I am getting this error message in Google Chrome Development tools:

This is likely caused by incorrect HTML markup, for example nesting block-level elements inside

, or missing . Bailing hydration and performing full client-side render.

I noticed when I remove component this error message disappears. How to fix this?

I saw questions with similar titles such as this one: Vuejs Error: The client-side rendered virtual DOM tree is not matching server-rendered but I already know which component causes the problem.

This happens both in Chrome and Firefox

Upvotes: 0

Views: 2396

Answers (1)

Socrates Tuas
Socrates Tuas

Reputation: 181

Wrap the v-img with no-ssr. That will do it.

<no-ssr>
  <v-img
    src="https://cdn.vuetifyjs.com/images/cards/halcyon.png"
     height="125px"
      contain
  ></v-img>
</no-ssr>

Upvotes: 2

Related Questions