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

219
Views
Getting Uncaught TypeError: Cannot read properties of undefined (reading 'then') while working with Javascript Promise

I declare a window promise where I get a response and stor it in a JS ojbect. The script does not get executed. I am getting an error while working with the Javascript promise:

Cannot read properties of undefined (reading 'then')

window.promise.then(function(response) {
  var jsObject = JSON.parse(response);

  if (jsObject.enableEmailVerificationOnRegistration) {
    alert('hii enable verification tggle is on')
    var signUpClick = document.getElementById("registrationSignUp");
    signUpClick.addEventListener('click', function(e) {
      event.preventDefault();
      var getPdpUrl = window.parent.location.pathname;
      document.getElementById("pdpUrlValue").value = getPdpUrl;
      localStorage.setItem("currentPdpPath", getPdpUrl);
      window.location.href = getPdpUrl;
    });
  }
});
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!