Hi!
I’m trying to get all NFTs from a wallet using Moralis.EvmApi.nft.getWalletNFTs
and it worked fine for a while but new I keep getting
MoralisError [Moralis SDK Core Error]: [C0008] Default instance of Core is not set
when using response.result
.
I’m running my code server-side on NodeJS and based my code on this documentation: https://docs.moralis.io/web3-data-api/evm/reference/get-wallet-nfts
Setup:
NodeJS v18.11.0
dependencies: {
'@moralisweb3/common-evm-utils': 2.16.1
moralis: 2.14.3
}
Code:
import Moralis from "moralis";
...
if (!Moralis.Core.isStarted) {
await Moralis.start({
apiKey: MORALIS_API_KEY,
});
}
const response = await Moralis.EvmApi.nft.getWalletNFTs({
chain:"0x13881",
format: "decimal",
"0x...",
});
console.log(response.result);
This returns the following error:
MoralisError [Moralis SDK Core Error]: [C0008] Default instance of Core is not set
isMoralisError: true,
code: 'C0008',
details: undefined,
[cause]: undefined
Any ideas?
UPDATE:
If I use response.toJSON().result
instead then it seems to work but shouldn’t response.result
just work? I mean, it was working before!!