Rarible Clone dilemma

Try this plugin:
https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer#review-details

That’s the one I’m using

https://marketplace.visualstudio.com/items?itemName=techer.open-in-browser#review-details

Its my metamask web 3 extension. I only had the metamask ext. Smh. Now it says object object… How should i set the settings in the metamask web3 ext?

Now it says cannot read property map

Does the metamask have to be preset to a particular testnet?

Take a look at adding custom Network RPC

If you have tested your code on sandbox and it woked fine, so there is a problem with your localhost live server

1 Like

That’s gotta be the answer but i dont have a chain id number to fill in

Hey @SolidCircle
Did you manage to solve the problem?

No. This is probably a dumb question, but am i supposed to actually download ganache? I was just about to do the command : npm install -g ganache.cli

Because I can’t configure my metamask wallet to my local server, but do i even have a local server. Rookie questions, i know…

I ran ganache but that didn’t help. Hmmm… it gotta be something simple that I’m not doing. Its not the code or the server. Then its gotta be the wallet. Im using the Brave browser, could that be it?

@SolidCircle take a look at a short video
https://www.youtube.com/watch?v=nUEBAS5r4Og

That’s the video i watched that got me tobdownload ganache. But after i download it and run it, still says the same thing. Question: When i run command : python3 -m http.server ; what server is that running on? Its not ganache because it was running and allowing me to access the site before i downloaded ganache.

@SolidCircle
If you want to start your live server for the site you can just click on your HTML file in the VS code and select open in default browser.

To start your ganache server you can easily start the Ganache App (GANACHE QUICKSTART)

I tried a few things. Ganache, but its not needed for this project. I’ll repost the code and see if it still runs right on your server…

<!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>Culture</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>
Moralis.initialize("LLe95gObRCYtxHc8EUnBfLByDfBWRFEZkjlNRXa0JXa0J");
Moralis.serverURL = 'https://ldkjffesu0ln.usemoralis.com:2053/server'

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();

I hate to be a bother, but did u get a chance to run that code again. I wanna be sure that none of the changes i made altered the code…

Hi, @SolidCircle.

Make sure to use the latest version of both the libraries instead of a specific one.

Change it to –

<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
 <script src="https://unpkg.com/moralis/dist/moralis.js"></script>

I was getting this error when using the specific version -

And it gets resolved once you use the latest versions as shown above

Hope this resolves the issue. :raised_hands: