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

199
Views
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
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!