syncEthAddress - Cannot read properties of null (reading 'number')

I’m using hardhat localhost and frpc to sync. I setup the server, connect my web app to the server. I login using Metamask. No email. I’m forking from Rinkeby, blocknumber 9693973. My wallet has some ETH in it and I’ve also transferred some tokens to it. So there are some transactions history existing for this address.

When I login, I see 1 row show up in the User table, EthBalance has 1 row, _EthAddress has 1 row. But I dont see any transaction tables.

If I look into Job Status, I see error on syncEthAddress. Cannot read properties of null (reading ‘number’). If I run the job again, I get different error: Address is required.

There is nothing in the logs, neither Info or Error.

I’ve deleted my server 2 times and created new, but always same result. It’s running version 0.0.291. “Historical User Sync” is on.

Javascript side is simple.

let user = await Moralis.User.current();
user = await Moralis.authenticate({
signingMessage: “Helloooo”
})

Any ideas?

I don’t know if it should work with that fork.

You could try to use it directly with rinkeby.

But I don’t want to use rinkeby directly, but rather my local hardhat instance.

I tried to run hardhat with no forking on my local machine, still get same error. This basically prevents me from using Event listening on localhost since transaction history isn’t loaded into MongoDb for users.

Could there be a bug in the Moralis software or am I doing something wrong here?

you could try moralis-admin-cli to connect: https://docs.moralis.io/moralis-server/web3/setting-up-ganache#connect-through-the-moralis-admin-cli

also on same page:

Forking Mainnet (not supported)
Note, the "Mainnet Forking" feature in Ganache CLI and Hardhat is not yet supported. Transactions and contract events will not sync due to the block numbers starting at an unexpected value. We hope to have support for this in the future.

If you try to start another Ganache or Hardhat instance from block 0, you should also delete your Moralis server and create another one

I’m using that cli tool and the tool in general seems to work fine, although it’s difficult to tell because no new transactions show up because of that error. I can see it communicating, so feels like it’s working

Maybe forking also isn’t supported from test nets, so that could be the reason. I tried to go from block 0 on my hardhat local but got same error.

Also when developing, it’s nice to fork from some blocknumber, because I’m taking tokens from contracts so it´s always good to know they have the balance needed, also when restarting hardhat and redeploying your own contracts always get the same address. So when you guys will start supporting forking, it would be good to be able reset MongoDb to that blocknumber each time you restart hardhat so you dont always have to delete the server and start again.

But I’ll start using Rinkeby, so it’s not stopping me.

Thanks for the help