While using social methods for login on our app with Web3Auth, I encountered some issues when trying to create createTypeSignedMessage. (Note: This error does not occur when using MetaMask.)
1. InternalRpcError: An internal error was received.
Details: Cannot read properties of null (reading ‘ok’) Version: viem@2.18.6 at AN.delay.count (index-BXZrYXCX.js:150:14308) at async o (index-BXZrYXCX.js:150:13829)
Caused by: Error: Cannot read properties of null (reading ‘ok’) at Dd (index-BXZrYXCX.js:105:107043) at Object.internal (index-BXZrYXCX.js:105:106381) at UD.t.sendAsync (index-BXZrYXCX.js:105:118466) at async UD.t.request (index-BXZrYXCX.js:105:118768) at async AN.delay.count (index-BXZrYXCX.js:150:14110) at async o (index-BXZrYXCX.js:150:13829)
2. Console Error: JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started).
Additionally, when trying to read data from the blockchain using contract.getCollectAmountByChallenge, the blockchain occasionally returns zero instead of the actual value.
@shahbaz The example you provided is not working, throwing same error as in my application -
Please track data for signed string
Error for detailed error messages
IsError for if there is error while doing the process
const { signTypedData, data, error, isError } = useSignTypedData()
console.log('data, error, isError ', error, isError)
I need the signature from the function execution, similar to your playground example. Here is the screenshot. When I console.log the “signTypeData” function, it only prints the function itself, not its return value. There are various use cases in for signed signature in our application.
Additionally, as I have mentioned multiple times, the bug only occurs when I sign in with social login. With MetaMask, it works correctly and returns a string. Please see the attached screenshot for reference 2.