Cannot read property 'member' of null custom registration form

I am building out a custom registration form lightbox that connects to my database collection. I have all the fields set and each input connected. I have very basic code straight from the Wix articles. https://support.wix.com/en/article/corvid-tutorial-creating-a-custom-registration-form-with-code. However, I keep getting this error message when I’m in preview mode. The error does say what line it is on either.

I have tried testing after publishing, but even though I don’t get the error message in this mode nothing happens with the database. It’s just empty. I am getting a Failed to load resource: the server responded with a status of 429 (TOO MANY REQUESTS) while viewing it live, but when I click on the link by the error it gives me this. {“error”:“No JSON data was found”}.I also have a syntax error for the index page but it doesn’t say where. The only javascript I have written for this site is for the custom registration form, so I don’t know what that is. I don’t know if these are the cause of the issue but I thought I’d mention them.

I also checked the permissions and it’s collection type FormSubmission and that anyone can create content this content. The dataset is connected to that collection.

Any help would be great. I’ve looked at other posts on this error but I haven’t been able to solve it yet.


import wixUsers from ‘wix-users’ ;
$w.onReady( function () {
$w( ‘#createAccount’ ).onClick(() => {
let emails = ;
emails.push($w( ‘#email’ ).value);

// register as member using form data
wixUsers.register($w( ‘#email’ ).value, $w( ‘#password’ ).value, {
“contactInfo” : {
“firstName” : $w( ‘#firstName’ ).value,
“lastName” : $w( ‘#lName’ ).value,
‘phoneNumber’ : $w( ‘#phoneNumber’ ).value,
‘companyName’ : $w( ‘#companyName’ ).value,
“emails” : emails
}
});
});
});

Where in your code is it “connected to the database collection”? What collection? Your code doesn’t show anything like that.

As noted in the wix-users API : The APIs in wix-users are only partially functional when previewing your site. View a published version of your site to see their complete functionality .

Hi, the inputs are connected to the database collection through the editor so not the code. I did happen to see that the contacts list is populated when this registration form is filled out. For example, when I got to the content manager and then go to the appropriate collection I can see it populated. However, when I go to my site structure within the editor and then to that collection, it’s not populated. I’m completely new to the Wix platform, so I could be missing something very fundamental.