You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
useWaitForTransaction hook throws an unhelpful error (t.substring is not a function) when a transaction is reverted. This could be because t(code) is likely undefined in the error handling core around here.
It would be significantly more helpful if waitForTransaction could return the exact reason for the transaction failure. This would allow developers to identify and address the specific issue causing the reversion.
For reference, here is an example from Tenderly of a transaction on Bungee Exchange that failed due to gas limit issues. However, wagmi threw t.substring() error, making it difficult to find the root cause.
To reproduce, you could go to Bungee Exchange and make a swap or bridge transaction with lower gas limit. (fails for 100000 gas limit)
Wagmi Version
^1.4.12
Viem Version
1.1.8
TypeScript Version
4.8.4
Check existing issues
I checked there isn't already an issue for the bug I encountered.
Anything else?
No response
The text was updated successfully, but these errors were encountered:
salil-naik
changed the title
waitForTransaction throws incorrect error (t.substring is not a function) on reverted transactions
waitForTransaction throws incorrect error (t.substring is not a function) on reverted transactions
Mar 19, 2024
This issue has been locked since it has been closed for more than 14 days.
If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest wagmi version. If you have any other comments you can create a new discussion.
Describe the bug
useWaitForTransaction
hook throws an unhelpful error (t.substring is not a function
) when a transaction is reverted. This could be because t(code) is likely undefined in the error handling core around here.It would be significantly more helpful if waitForTransaction could return the exact reason for the transaction failure. This would allow developers to identify and address the specific issue causing the reversion.
For reference, here is an example from Tenderly of a transaction on Bungee Exchange that failed due to gas limit issues. However, wagmi threw t.substring() error, making it difficult to find the root cause.
Failed Transaction on Etherescan: https://optimistic.etherscan.io/tx/0xe7e981763d8cbbe0f6ca8ed3b0ffcb87b8fc823fe736f9652ab56eabda60b02e
Link to Minimal Reproducible Example
No response
Steps To Reproduce
To reproduce, you could go to Bungee Exchange and make a swap or bridge transaction with lower gas limit. (fails for 100000 gas limit)
Wagmi Version
^1.4.12
Viem Version
1.1.8
TypeScript Version
4.8.4
Check existing issues
Anything else?
No response
The text was updated successfully, but these errors were encountered: