[Solved] console.js:35 Cannot read property 'member' of null

Hi guys,
I have made a customized Registration lightbox and every time user register there will be error. However the user still able to register and log-in/out without problem. ( I have asked the support center and they said ask here…)
Any idea??

Both errors appear twice at the same time:
mainr.js:120 POST https://nachrasia.wixsite.com/_api/wix-sm-webapp/v1/auth/register 500 (Server Error)
console.js:35 Cannot read property ‘member’ of null

—My code—

import wixUsers from ‘wix-users’;
import wixLocation from ‘wix-location’;
import wixWindow from ‘wix-window’;
import wixData from ‘wix-data’;

let pwok = “false”;

export function password_keyPress(event) {
console.log(event);
DisableEnable(event) //check if user input 4 or more digital in Password
}
function register(event) {
let fadeOptions = {
“duration”: 500,
“delay”: 0
};

if (pwok === “true”) {
$w(“#pwerror”).hide();
$w(‘#regenter’).enable();

    $w("#regenter").onClick(() => { 
        $w("#error2").hide(); 

        wixUsers.register($w("#email").value, $w("#password").value) 
            .then(() => { 
                wixWindow.lightbox.close(); 
                wixLocation.to('/account/signup'); 
            }) 
            . catch ((err) => { 
                console.log(err); 
                $w("#error2").show("fade", fadeOptions); 
            }); 
    }); 
}  **else**  { 
    $w('#regenter').disable(); 
} 

}

function DisableEnable(event) {
let realValue = “”;
let fadeOptions = {
“duration”: 500,
“delay”: 0
};

switch (event.key) {
case “Shift”:
case “Control”:
case “Alt”:
case “Meta”:
// these keys were pressed, so don’t add event.key to the realValue variable.
realValue = event.target.value;
break ;
case “Backspace”:
let PrevValue = event.target.value;
let NewLength = PrevValue.length - 1;
realValue = PrevValue.slice(0, NewLength);
break
default :
realValue = event.target.value + event.key;
break ;
}

if (realValue.length >= 4) {
pwok = “true”
console.log(“pw event ok”)
$w(“#pwerror”).hide()
.then(() => { register(); });

}  **else**  { 
    pwok = "false" 
    $w('#pwerror').show("fade", fadeOptions) 
        .then(() => { register(); }); 

}

$w.onReady( function () {
$w(“#password”).onKeyPress(DisableEnable);
});

It looks like this

the error says that something is trying to read the property “member” from an object that is empty “null”. so to determine what is the problem you should look for that element or piece of code that is trying to read that property. you can start by looking at which line of code is the error outputed or marked in the error message.

Thank you @nextecs .I just checked and found that I must use
email.push($w(‘#email’).value);
which I have no idea what is it. But it is now solved!

async function signUpMember(response, cus, lastFour, brand, subStatus) {
console.log(“signing up wix member”); //show when member sign up starts
let array = [];
let phone = $w(“#phone”).value;
await array.push(phone);
wixUsers.register($w(“#email”).value, $w(“#password”).value, {
“contactInfo”: {
“firstName”: $w(“#fName”).value,
“lastName”: $w(“#lName”).value,
“phones”: array,
“country”: $w(“#country”).value
}
})
.then((result) => {
console.log(“signing up wix memeber”); //show when member sign up starts
confirmInsertSuccess(response, cus, lastFour, brand, subStatus);

})
. catch ((err) => {console.log(could not insert into paying members: ${err}); //show when member sign up starts
debugger
});
}

I am having a very similar issue with the exact same issue and have followed the wix user register function code very closely. Any ideas what I am doing wrong with my above code 

When submitting a post, please make sure to follow these guidelines . Your code (and not your question) should be formatted and inside of a code block to make it easier to read.

I am closing this thread as it is old.

You have not explained what isn’t working. Please repost your question, and explain what it is you are trying to do, what is working, and what is not.