Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

359
Vistas
Nuxt.js head() inside error layout not working when using in fetch() hook at SSR

When we throw Nuxt error function in new fetch() hook with this.$nuxt.error() syntax, the title of error page which is not found is not applied in browser when using SSR (e.g: refreshing index page) and the title is empty (or its the same as defined in nuxt.config.js). But it works when on client side (e.g: switching between routes)

/layouts/error.vue

<template>
  <div>404 not found!</div>
</template>

<script>
export default {
  head() {
    return {
      title: "not found",
    };
  },
};
</script>

/pages/index.vue

<template>
  <div />
</template>

<script>
export default {
  fetch() {
    this.$nuxt.error({
      statusCode: 404,
      message: "Page not found",
    });
  },
};
</script>

Is it a bug or I miss something?

Codesandbox sample project link

Nuxt.js version: 2.15.8

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda