Ethereum Boilerplate Questions

ERC721 will work.
If you are seeing same error after changing the chain, then maybe be verify if you are listing the nft from owner wallet address.

I switched to yarn install instead of npm install and it worked just fine

Hi to all! I have some issues with ethereum-boilerplate. Please help!

Drop-down menu for changing blockchains, and wallet balance in header disappear when I change network. I need to refresh the page for those to be visible again. Is there a way to change it without manually refresh the page?

Fiat section is blank, it’s probably cause I messed something with installation of fiat Onramp plugin.


.
Also, NFT balances doesn’t show picture of NFT.

Can you post that CryptoBlades contract address or your wallet address? Maybe the images aren’t being rendered properly or the app doesn’t know how to handle them.

As you’ve made changes, you can look at the boilerplate repo to compare your code to get those things working again. The fiat page and chain dropdown work fine in the demo.

And check your browser console for any errors.

ethereum-boilerplate repo

Thank you for the response and links.

This is what I have now on the fiat page. I messed up with the Onramper API key when I installed the plugin. Where I can find it?

This is CryptoBlades contract address.
https://bscscan.com/address/0x7e091b0a220356b157131c831258a9c98ac8031a

I made only this change since I got no-unsafe-optional-chaining error:

From browser console:

This is what I have now on the fiat page. I messed up with the Onramper API key when I installed the plugin. Where I can find it?

The Onramper API key can found from your Onramper account dashboard and you can add or find it in your Moralis server settings. That should fix that issue, that page should be giving a Wrong API Key error in console.

From browser console:

I have cloned the project and yes I did get your issues where you can’t authenticate properly or the chain dropdown didn’t work.

What fixed it was creating and using a new server - both mainnet or testnet worked. Can you try this?

Also, NFT balances doesn’t show picture of NFT.

On my end using a random wallet address, a few NFTs of this collection show up.

The rest give issues of Invalid URI, this is because some of the tokens don’t have their token_uri synced.

You can use the reSyncMetadata API to sync the token_uri for these tokens. For now, you will have to do this for each token_id with missing token_uri / metadata as token_uris not on IPFS so they won’t resync automatically.

1 Like

You were right about Onramper API key. I needed to go this page and fill out the form to get the API key.

And then add that key to installed Onramper plugin on Moralis server I’ve created.
Now it’s working:

Although I created new server as you suggested, and clear all history including data in my browser,
I still need to manually refresh the page when I change network from drop down menu in header section, in order to drop down menu and wallet balances be visible in header again.

So the network does change successfully (MetaMask is prompted) but the app doesn’t refresh? Are you getting any errors in browser console now?

Yes, the network does change successfully (MetaMask is prompted) but the app doesn’t refresh. I need to manually refresh the page to drop down menu with networks to be visible again.

Console before connecting to Metamask wallet:

Console after connection to Mettamask wallet:


image

where my nft will show up after listing it for sale because i can’t see it in the explore page ?

Under the marketplace page in collections, these NFT’s will be marked as on sale.
NFT’s that are on sale and not on sale will appear on marketplace page only

Updating react-moralis to the latest version e.g. npm install react-moralis will fix this.

Let me know if doing this breaks something else in the boilerplate.

1 Like

Thank you very much!
I run: npm install react-moralist in Git Bush and it’s solved the problem with refreshing. The dapp seams to run smoothly now. :grinning:

What about this warnings when I run yarn install


I suppose I can delete package-lock.json.But what about these other warnings, can I ignore this?

And one more warning after running yarn start

okay so i can see the listed NFT in the collection. But I can’t buy it not !

That message will be displayed if there is no object for this NFT in your Moralis server’s MarketItems Class. Can you doublecheck this.

What about this warnings when I run yarn install

Likely due to conflicts with installing the latest react-moralis, I did not encounter any of these although I am using npm. Possibly installing some of the latest dependencies like eslint will fix some of these, you can try it, but keep a note of the previous version so you can revert if things break.

And one more warning after running yarn start

You can install the @web3auth/web3auth package to get rid of this warning but things should be working fine so you could ignore it unless you need to use web3auth.

Ok! Thanks for the help and tips!

I saw in the tutorial , the badge ribbon is supposed to be on currently listed market items on the NFT marketplace. but idk why in my case , i can’t see that on the listed items.

I’m getting this error as well in the NFTTokenIds.js
line31

Unhandled Rejection (SyntaxError): Unexpected token o in JSON at position 1

Line 31 in the NFTTokenIds.js github code is of css styles. If this is the line that is causing the error, then there must be a syntax error in the json properties.

If you are referring to some other code, can you paste the reference of that code.

Hi @johnversus , I’m getting this error , I am sorry , idk i typed 31 instead of line 25