error while trying to access user.getEmail()

Preflight response is not successful error is thrown while I try to get the current user,
email id using the wix-user API .
Can someone help.
This is my code.
import wixUsers from ‘wix-users’;
//import wixUsers from ‘wix-users-backend’;
//var userEmail; $w.onReady( function ()
{ let user = wixUsers.currentUser;
let userId = user.id ; // “r5cme-6fem-485j-djre-4844c49”
let isLoggedIn = user.loggedIn; // true
user.getEmail() .then( (email) => {
let userEmail = email; // "user@something.com "
$w(" #text21 ").text=userEmail; } );
});

Thank You !

Please post the editor URL of your site. Only authorized Wix personnel can get access to your site in the editor. Please include the name of the page involved.

Hi Yisreal,

Thank you for the quick response.
this is the editor URL

The Page where I’m facing this issue is a MemberPage called Donations. You will find it under Member Pages> Donations.

I really appreciate your help !