My site suddenly doesn't work this week.

Hi,

This is really bugging me at the moment. I have 2 wix premium sites running. Currently one site returns 500 server error whenever register() is called, the other one is completely fine. I was testing whether the api is working or not, so for simplistic’s sake, I ran the following code on both sites. And the result is persistent, one works and one doesn’t. This makes no sense to me, and it’s been ongoing for a while. The site in question https://www.thecollective.trives.co/ had been running fine in the past, but suddenly the register() function just doesn’t work any more since today. It has been unstable this week regardless. Can someone from the Wix team please look into this? Thanks.

I’ve attached screenshots of the error.

import wixUsers from ‘wix-users’;

$w.onReady( function () {
let email = “test@test.com
let password = “testpassword”

wixUsers.register(email, password) 
    .then(result=>{ 
        console.log("registered") 
    }) 
    . catch ("error") 

});

Trying to look into it a bit more. Can anyone help me with this?

Hey, I recently had this exact same issue and spent hours trying to figure out what I could do to fix it, eventually assuming it was a Wix server-side error. HOWEVER, I made a change to my code that I believe got rid of the error, even though I hadn’t previously been getting the error:

  1. I removed the .toLowercase() call from a line I had: “let email = $w(‘#email’).value.toLowercase();”, making it simply “let email = $w(‘#email’).value;”.
  2. I changed the register() call from including 3 parameters (email, password, contactInfo) to just the first 2 parameters (email, password).

I’m not entirely sure which of the above was the reason that things started to work for me again, but I know that when I undid these changes the server 500 error reappeared. I would suggest changing any .toLowercase() calls you have to .toLocaleLowercase() calls, and possibly remove the ability to add contact info at registration.