Web3.eth.personal.sign undefined

I would like to let users sign messages.

I tried:

const {account,Moralis,chainId, web3 } = useMoralis();
const signed_message = await web3.eth.personal.sign(dataToSign, address)

But it looks like web3.eth is undefined (I checked and isWeb3Enabled is True)

Thank you

it may be that web3 is an ethers instance now, and maybe the syntax is different for ethers

also, you may need to enable web3 before trying that

You’re right, thanks.

Just do:

const {web3} = useMoralis();
let signer = web3.getSigner();
let signature = await signer.signMessage('Some data')