-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read properties of null (reading 'attributes') #11
Comments
It works totally fine when testing with the BAYC collection + metadata, wondering if it's something to do with my tokens starting at 1 and not 0? Any way to fix this? The contract address I'm trying to generate rarity for is: |
i am stuck here as well - I hope moralis reaches out about this |
Apparently some collections cause this issue on Moralis like Invisible Friends, Cryptopunks V3, Pepe Universe and some others. |
where do you toss that in |
sorry, use this instead let collection = allNFTs.map(e => { let metadata = collection.map(e => e.metadata); for (let i = 0; i < metadata.length; i++) { |
what lines do you add that to/ replace |
you would replace the line with let metadata = allNFTs.map((e) => JSON.parse(e.metadata).attributes); with let collection = allNFTs.map(e => { let metadata = collection.map(e => e.metadata); for (let i = 0; i < metadata.length; i++) { |
running into this now: let nftTraits = metadata[i].map((e) => e.trait_type); TypeError: metadata[i].map is not a function appreciate your help a ton |
where is this? |
TypeError: Cannot read properties of null (reading 'attributes') at /Users/timemachine/Downloads/Rarity-Ranking-NFT-main/generator/main.js:38:59 at Array.map (<anonymous>) at generateRarity (/Users/timemachine/Downloads/Rarity-Ranking-NFT-main/generator/main.js:38:26)
The text was updated successfully, but these errors were encountered: