Error: "n.data.substring
is not a function", when setting web.eth.handleRevert = true
#5999
Closed
1 task done
Is there an existing issue for this?
Current Behavior
When setting
web.eth.handleRevert = true
and calling any Smart Contract method that reverts with an error:The following error is raised: "
n.data.substring
is not a function".Expected Behavior
To return an error that contains the actual error from the Smart Contract.
Steps to Reproduce
The full details are at: #5677 (comment)
Web3.js Version
1.8.2
Environment
No response
Anything Else?
The current version of the Infura provider seems to be updated to put the error inside

data.data
. And here is what the internal object looks like with Infura:And so we need to update web3.js to handle this. And here is the line that needs to be changed:
web3.js/packages/web3-core-method/src/index.js
Line 629 in 2948927
And it could be changed to something like:
The text was updated successfully, but these errors were encountered: