Error 141 invalid hex number

code was working fine a few hours ago but I am getting this error now

{ code:141,error: 'Invalid hex number' }

I have tried to update and restart my server as well as tried to delete and create a new server instance, but to no avail.

I am trying to use the getNFT function under the Web3API Accounts APIs

This is my code:

async getNFTs() {
        const address =;
        this.testnetNFTs = await Moralis.Web3API.account.getNFTs({ chain: 'rinkeby', address: address });
   } catch(e) {

can you add a console.log(address) there to see what you have?

it prints out β€˜value’

upon checking further, the function only works when I hardcode the address in the Moralis.Web3API.account.getNFTs({ chain: 'rinkeby', address: address });
function, and does not work when I put in and putting this in gives me the invalid hex number error.

but the reason I used was because I posted another issue in the forum here: getNFT function under Accounts API (Web3 API)

any advice on what I should put under address in Moralis.Web3API.account.getNFTs({ chain: 'rinkeby', address: address }); to get the user’s address dynamically? technically I presume I do not even need to key in the address explicitly as it should pick it up from Moralis.Web3API.account. I am using typescript which is why I presume I need to key it in explicitly.

sorry, I think I should have put this under JavaScript / Moralis and not technical issue reporting.

you can get the address dynamically, but probably with a different syntax.

From current authenticated user:

user = await Moralis.User.current()

from web3:

account = (await web3.eth.getAccounts())[0]