Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

719
Visualizações
Nuxt - Node.appendChild: Cannot add children to a Comment

When deploying my Nuxt app in production mode to Firebase I get the following error whenever I attempt to navigate to any page other than the homepage:

Node.appendChild: Cannot add children to a Comment

I've found that when I comment my home-slider component in index.vue I no longer get this error, however commenting everything inside the home-slider while still leaving the component call throws the error.

index.vue template

<template>
  <article>
    <div v-if="slides && slides.length > 0">
      <section id="banner">
        <div class="container">
          <client-only>
            <home-slider :slides="slides"></home-slider>
          </client-only>
        </div>
      </section>
    </div>

    [...unrelated html]
  </article>
</template>

HomeSlider.vue template

<template>
  <div>
    <Splide id="home-slider" :options="options">
      <SplideSlide v-for="slide in slides" :key="slide.id">
        <a :href="slide.enlace" class="slide">
          <div
            class="slide-content"
            v-html="slide.contenido"
            v-show="slide.contenido"
          ></div>
          <div class="img-container">
            <img :src="slide.imagen" :alt="slide.titulo" />
          </div>
        </a>
      </SplideSlide>
    </Splide>
  </div>
</template>

Removing the client-only component also fixes it, but then splide won't render correctly.

According to this github issue this could be related to invalid HTML, however I can't see what's causing it, I can see that when I navigate to any route it first renders index.vue, then it tries to render the other page, is there a way to prevent other pages from rendering?

I have another Splide in a different page which doesn't seem to be giving me any issues when I navigate to the homepage.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda