getNFTs returns 141

Hi,
our dapp suddenly stopped working.

Calling getNFTs or getNFTbyContract returns

var NFTs = await Moralis.Web3API.account.getNFTs({ chain: chain, address:address});

{"code":141,"error":"[object Object]"}

I upgraded to the server to version 0.0.282 and I’m importing the sdk with:

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

Many thanks for your help

It looks like it is a problem on our side, I’ll get back with updates

It should be fixed now, it was a problem on our side. Thanks for reporting.

1 Like

Thanks for the quick fix!

I’m having the exact same problem, but it doesn’t seem to be fixed on my end.
Trying getAllTokenIds() on contract address 0x495f947276749ce646f68ac8c248420045cb7b5e on Ethereum’s mainnet.
The content of error is undefined.

1 Like

What output you expect with getNFTs for a contract address?

My bad, I meant getAllTokenIds(), I edited my answer.
I expect the output to be :

const tokens: {
  total: number;
  page: number;
  page_size: string;
  result: <tokens and their metadata>[];
}

I get this:

x = await Moralis.Web3API.token.getAllTokenIds({address: "0x495f947276749ce646f68ac8c248420045cb7b5e", chain:"eth"})
=>
{total: 1044570, page: 0, page_size: 500, result: Array(500)}

It works most of the time, but sometimes it doesn’t and since most of my app depends on this getAllTokenIds(), the only thing I can do is to setup an automated retry on that promise until it resolves.

ok, it worked for me on few tries, you can also update your Moralis server and maybe you will get a better error message.

What do you mean by :

you can also update your Moralis server

In your admin interface, for a server you have an option/button to update/restart server. There was an update today for better error messages on web3api calls.

1 Like