Rarity Generator Errors

After getting a bunch of undefined metadata errors, I saw a suggestion that refreshing the server might help.

Instead it just caused new errors . . .

C:\Users\...\Desktop\NFTs\Rarity Ranking\Rarity-Ranking-NFT-main\node_modules\moralis\lib\node\RESTController.js:433
        error = new _ParseError.default(errorJSON.code, errorJSON.error);
                ^

ParseError: Invalid function: "getPluginSpecs"
    at handleError (C:\Users\...\Desktop\NFTs\Rarity Ranking\Rarity-Ranking-NFT-main\node_modules\moralis\lib\node\RESTController.js:433:17)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Function.initPlugins (C:\Users\...\Desktop\NFTs\Rarity Ranking\Rarity-Ranking-NFT-main\node_modules\moralis\lib\node\MoralisWeb3.js:255:40)
    at async Function.start (C:\Users\...\Desktop\NFTs\Rarity Ranking\Rarity-Ranking-NFT-main\node_modules\moralis\lib\node\Parse.js:135:7) {
  code: 141
}

you can try to update the server again, there were some problems with a particular server version (0.0.361)

1 Like

Will do. Thanks cryptokid!!

@cryptokid Ok, that worked.

The new version put me back to the error I was having before,

Running the Rarity Generator (main.js), I start getting undefined metadata after it finds the traits of the first 53 NFTs in the collection. Iā€™ve looked at the NFTs in question on other platforms and there is nothing unusual. Iā€™ve tried a manual resync on the same few tokens, to no avail. main.js seems to be functioning correctly, until the undefined metadata hits this line:

let nftTraits = metadata[j].map((e) => e.trait_type);.

Obviously, the error points me there, but I donā€™t think itā€™s an issue with the code.

I am not sure where to look for answers. Any thoughts? :pray:

I donā€™t really have an idea now.

every time it stops after 53 nfts?

you could try to log that metadata object to see what it has

Ya, 53 . . .? Itā€™s very consistent.

I was logging all of it, and it comes back with 53 sets of traits, and then the word ā€œundefinedā€ over and over.

  [
    { trait_type: 'Backgrounds', value: 'Yellow_Suite' },
    { trait_type: 'LRMHead', value: 'LRMHead_14' },
    { trait_type: 'LRMMouth', value: 'LRMMouth_02' },
    { trait_type: 'LRMEyes', value: 'LRMEyes_12' },
    { trait_type: 'LRMGlasses', value: 'LRMGlasses_05' }
  ],
  undefined,
  undefined

I got another error this time:

at processTicksAndRejections (node:internal/process/task_queues:96:5)

you could try to look at the code that initialises that array with traits

Iā€™m not sure how to do that. I will do my best to figure it out. Thanks for your time!

This problem goes away when I resync metadata.

I guess the only way to calculate rarity is to resync the entire collection first.

Any idea how that could be done without using the manual input?