getUser() function is returning an empty object

Hi guys!
I have a page where (signed in) users can submit some data for an order. When the data is submitted, I send an automatic email with the data which is submitted. To this data I want to add PrivateMembersdata such as name, email, address, … . So get the private membersdata, I am using
the following backend code :

//.jsw file

import wixUsersBackend from 'wix-users-backend';

export function getUser(id) {
 return wixUsersBackend.getUser(id);
}

The page code is :

import wixUsers from 'wix-users';
import wixData from 'wix-data';
import {getUser} from 'backend/getttinguserdata';

$w.onReady(function () {
  $w("#Bestellingendataset").onAfterSave( () => {
     if(wixUsers.currentUser.loggedIn) {
     const userId = wixUsers.currentUser.id;
     console.log(getUser(userId));
     wixUsers.emailUser("Bevestigings_email_met_data", userId, {
         "variables": {
         //Achternaam: lastName,
         //Voornaam: wixUsersBackend.UserInfo(firstName),
         //"Email": [userEmail],
         //adres: wixUsersBackend.Address,
         //Telefoon: ,
         "Voorkeurleveringophaling": $w("#inputlevering").value,
         "Voorkeur": $w("#inputvoorkeur").value,
         "Opmerkingen": $w("#inputopmerkingen").value,
         "Datum": $w("#inputdatum").value,
         "debestelling":$w("#inputbestelling").value
                }
                } )
         .then( () => {
             console.log("Succes");
          } )
          .catch( (err) => {
             console.log(err);
          } );
    }
  } );
} );

I am getting the following result as output

Why is it returning an empty object? Is there any way to fix this? Is there another way how to get the privatemembers data?

Thanks in advance!
Kind regards

Hi,

This may be happening because you are previewing and testing the site within the editor. All wixUsers methods are limited in preview and it is recommended to test the site in the live version. You can use the site monitor to track your sites logs by using the site monitor .
If you continue to get an empty object when testing on the live site, please send us the URL of the site so we can further assist you.

Best regards,
Edward