Property 'then' does not exist on type 'Element' in Wix error. HELP!!!!

Additionaly to Giri’s suggested answer…

Perhaps you should also consider to do the registration on backend…

FRONTEND-CODE:

import { myRegisterMemberFunction() } from 'backend/REGISTRATION.jsw'
$w.onReady(()=>{$w('#register').onClick(function(){registerUser();});});
    
function registerUser(){
    let options = {
        contactInfo: {
            firstName: $w('#firstName').value,
            lastName: $w('#lastName').value
        },
        privacyStatus: "PUBLIC"
    }
    myRegisterMemberFunction($w('#email').value, $w('#password').value, options);
}

BACKEND-CODE: (REGISTRATION.JSW)

import { authentication } from 'wix-members-backend';

export function myRegisterMemberFunction(email, password, options) {
return authentication.register(email, password, options)
    .then((member) => {
    return member;
    })
    .catch((error) => {
    console.error(error);
    })
}