[SOLVED] ParseError [I CLONED RARABLE IN 24 HOURS pt1]

I have just finished part 1 of the rarable video and starting to have problems.
after clicking on Connect Wallet, i sign the signature request but the ParseError shows:

ParseError: 101 Signing message has expired.

here is my JS file:

Moralis.initialize("##########");

Moralis.serverURL = '############'

init = async () => {

        window.web3 = await Moralis.Web3.enable();

        initUser();

}

initUser = async () => {

    if (await Moralis.User.current()){

        hideElement(userConnectButton);

        showElement(userProfileButton);

    }else{

        showElement(userConnectButton);

        hideElement(userProfileButton);

    }

}

login = async () => {

    try {

        await Moralis.Web3.authenticate();

        initUser();

    } catch (error) {

        alert(error)

    }

}

hideElement = (element) => element.style.display = "none";

showElement = (element) => element.style.display = "block";

const userConnectButton = document.getElementById("btnConnect");

userConnectButton.onclick = login;

const userProfileButton = document.getElementById("btnUserInfo");

init();

Here is my HTML:

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Morarables</title>

</head>

<body>

    <div>

        <button id="btnConnect">Connect Wallet</button>

        <button id="btnUserInfo">Profile</button>

    </div>

    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/web3.min.js"></script>

    <script src="https://unpkg.com/[email protected]/dist/moralis.js"></script>    

    <script src="main.js"></script>

</body>

</html>

This syntax is deprecated :

You need to change it to the new syntax:

serverUrl = "https://xxxxxx:2053/server"
appId =  "xxxxxx"
Moralis.start({ serverUrl, appId});

There seems to be more problems now. The buttons are not responsive after changing to the new syntax.

You can replace the following

<script src="https://unpkg.com/moralis/dist/moralis.js"></script>

And these too in your main.js

await Moralis.enableWeb3();
await Moralis.authenticate();
1 Like

that seems to have fixed my issue! Thank you :slight_smile: