Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

194
Views
Obteniendo: error "No capturado (en promesa) TypeError: no se puede convertir indefinido o nulo en objeto" al intentar registrar una cuenta

Estoy tratando de hacer que el código del sistema de inicio de sesión funcione en vuejs, sin embargo, cuando intento registrarme, siempre aparece este error:

Uncaught (in promise) TypeError: Cannot convert undefined or null to object at Function.keys (<anonymous>) at VueComponent.setErrors (vee-validate.esm.js?7bb1:1892) at eval (Register.vue?0103:282)

En vee-validate.esm.js, esta es la parte que muestra el error:

 setErrors: function (errors) { var _this = this; Object.keys(errors).forEach(function (key) { var provider = _this.refs[key]; if (!provider) return; var errorArr = errors[key] || []; errorArr = typeof errorArr === 'string' ? [errorArr] : errorArr; provider.setErrors(errorArr); }); this.observers.forEach(function (observer) { observer.setErrors(errors); }); }

Y aquí está la parte en register.view que muestra el error:

 .catch((error) => { this.$toast({ component: ToastificationContent, position: "top-right", props: { title: "Register failed!", icon: "CoffeeIcon", variant: "danger", }, }); error.hasOwnProperty("response") ? this.$refs.registerForm.setErrors(error.response.data.error) : this.$refs.registerForm.setErrors(error.error); }

Intenté agregar if (errors != null) antes de la parte Object.keys(errors), pero eso solo elimina el mensaje de error, sin embargo, el código aún no se ejecuta. Soy bastante nuevo en vuejs, por lo que agradecería cualquier ayuda.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!