Having issues with wix-frontend code

I’ve been working on creating a custom points system. So whenever a member posts a blog, it will give them a certain number of points each time.

I added the backend code with no errors, but I’m having issues with the frontend code now. Could anyone check this code for me to see what I’m doing wrong? I have 2 errors I made bold next to each field given me the error.

Thanks

front-end code below

import wixUsers from ‘wix-users-frontend’; (Error - Cannot find module ‘wix-users-frontend’ or its corresponding type declaration. You can search for alternatives in the Package Manager.)
import members from ‘wix-members-frontend’;

$w.onReady(function () {
// Check if the current user is logged in
if (wixUsers.currentUser.loggedIn) {
// Show the text element (you can have it hidden by default)
$w(‘#loyaltyPointsText’).show();
loadMemberPoints();
} else {
// If no user is logged in, hide the text element
$w(‘#loyaltyPointsText’).hide();
}
});

function loadMemberPoints() {
// Get the full member details for the current user
members.getCurrentMember (Error - Property ‘getCurrentMember’ does not exist on type 'typeof import(“wix-members-frontend”). Did you mean ‘currentMember’?({ fieldsets: [‘FULL’] })
.then((member) => {
if (member) {
// Get the points from the custom field. Default to 0 if not found.
const points = member.contactDetails.customFields?.[‘loyaltyPoints’] || 0;

    // Display the points in the text element
    $w('#loyaltyPointsText').text = `Your Loyalty Points: ${points}`;
  }
})
.catch((error) => {
  console.error("Error fetching member points:", error);
  $w('#loyaltyPointsText').text = "Could not load points.";
});

}

Hi, @Damian_Crauford !!

Hello. First of all, I’d say that wix-users-frontend was deprecated quite a while ago, so using only its successor, wix-members-frontend , should be sufficient. :innocent:

Regarding the second error , please refer to the following link.