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

201
Vistas
Getting: "Uncaught (in promise) TypeError: Cannot convert undefined or null to object" error when trying to register an account

I'm trying to get login system code working in vuejs, however when I try to register, it always gives this 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)

In vee-validate.esm.js, here's the part that shows the 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);
        });
    }

And here's the part in register.view that shows the 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);
        }

I've tried adding if (errors != null) before the Object.keys(errors) part, but that only gets rid of the error message, however the code still doesn't run. I'm pretty new to vuejs so any help would be appreciated.

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