Moralis.Web3API.native.getTransaction TypeError: Cannot read properties of undefined (reading 'page_size')

/* import moralis */

const Moralis = require("moralis/node");

/* Moralis init code */

const serverUrl = "............";

const appId = "..";

const masterKey = ".....";

Moralis.start({ serverUrl, appId, masterKey });

const tran = async () => {

const options = {

    chain: "eth",

    transaction_hash:

      "0x188232a3639f5a10ff097178519cb017f49bb3430fba10b29b21eb8e343b98f7",

  };

const transaction = await Moralis.Web3API.native.getTransaction(options);

console.log(transaction);

}

tran();

what is issue with this code.

I’ll test it a little later. I would not expect that error. What line gives that error?

if (!result.page_size || !result.total || result.page === undefined) return options;
^

TypeError: Cannot read properties of undefined (reading ‘page_size’)

What version of Moralis SDK you are using?

latest version of SDK

I was able to reproduce the problem, it happens in this particular case because that transaction hash is not present on eth and this problem happens only on latest versions of Moralis SDK.

1 Like

ok thanks for information