I thought Iād share my current workaround code for getting all the NFT images to workā¦
Iām using an API web proxy that I set up (https://workaround-proxy.herokuapp.com/) for when the initial load fails and that works. So, now we have a proof of concept.
Pastebin for the code: https://pastebin.com/wVyzCvH0
useEffect(() => {
async function fetchNFTs() {
if (data?.result) {
const NFTs = data.result;
for (let NFT of NFTs) {
if (NFT?.metadata) {
NFT.metadata = JSON.parse(NFT.metadata);
// metadata is a string type
NFT.image = resolveLink(NFT.metadata?.image);
} else if (NFT?.token_uri){
try {
await fetch(`https://workaround-proxy.herokuapp.com/${NFT.token_uri}`)
.then(response => response.json())
.then(data => {
NFT.image = resolveLink(data.image);
});
} catch (error) {
console.log(error);
console.log(NFT.token_uri);
}
}
}
setNFTBalance(NFTs);
}
}
fetchNFTs();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [data]);
ā¦ Iāll probably disable the proxy after a while, but you can test it out for now if you want to.
**
I donāt know the username of the person who did the YouTube video, but they should have some NFTs with this problem in their account since it was showing up in the video.
So they should be able to test this fix.