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

183
Vistas
How to handle client-side JavaScript errors with Nuxt.JS

I'm trying to show an error page when an error occurs on the client side Javascript of Vue components.

In dev mode, I get a customer error page I've created in the layouts/error.vue page whenever the client runs into an error. But when I build and start the app no error page is displayed even though the error is logged in the console. This error page is only displayed for server errors.

I've tried creating a custom error handling component using the following code:

mounted() {
  window.onerror = this.onError
},
methods: {
  onError(msg, source, ln, cn, err) {
    console.log('Error received')
    this.show = true
    this.error = { msg, source, ln, cn, err }
  }
}

However, this function does not seem to handle the client sides error that occurs.

Does anyone know what the best way is to handle all unhandled clients side errors?

about 4 years ago · Santiago Gelvez
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