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