useDApp
useDApp copied to clipboard
"failed to check transaction hash" errors when using Rinkeby in "Getting Started" example
Apologies if this is an issue on my end but I spent a lot of time debugging this and not making any progress.
I created a react app using the official "Getting started" example . (same code)
The code above works for Mainnet, but as soon as I switch to Rinkeby, I'm getting spammed by the following error (hundreds per second):
failed to check transaction hash: undefined Error: invalid hash (argument="value", value=undefined, code=INVALID_ARGUMENT, version=providers/5.5.0)
at Logger.makeError (index.ts:225)
at Logger.throwError (index.ts:237)
at Logger.throwArgumentError (index.ts:241)
at Formatter.hex (formatter.ts:221)
at Formatter.hash (formatter.ts:267)
at Web3Provider.<anonymous> (base-provider.ts:1570)
at Generator.next (<anonymous>)
at fulfilled (base-provider.ts:1)
Does anyone have an idea of what's going on?
Here is my code:
import { DAppProvider, useEtherBalance, useEthers, Config, Rinkeby, Mainnet } from '@usedapp/core'
import { formatEther } from '@ethersproject/units'
import React from 'react'
import ReactDOM from 'react-dom'
const config: Config = {
readOnlyChainId: Rinkeby.chainId,
readOnlyUrls: {
[Rinkeby.chainId]: 'https://rinkeby.infura.io/v3/383bd90f028a44279e65d3a839f3cec3',
},
}
ReactDOM.render(
<React.StrictMode>
<DAppProvider config={config}>
<App />
</DAppProvider>
</React.StrictMode>,
document.getElementById('root')
)
export function App() {
const { activateBrowserWallet, account } = useEthers()
const etherBalance = useEtherBalance(account)
return (
<div>
<div>
<button onClick={() => activateBrowserWallet()}>Connect</button>
</div>
{account && <p>Account: {account}</p>}
{etherBalance && <p>Balance: {formatEther(etherBalance)}</p>}
</div>
)
}
same error on polygon
i have the same issue. it seems network specific
The problem has reappeared and is now happening all the time. Clearing the cache doesn't help anymore. The entire application stops responding due to the number of calls/errors.
Has anyone managed to find a solution?
~~I had a similar issue. Here's another one: https://github.com/EthWorks/useDApp/issues/430.~~
~~I can confirm that clearing local storage (Firefox, but it probably doesn't matter) has solved the problem. I can't reproduce it now. I also have multiple projects in my local environment, so maybe it's just some conflict between data from these projects. 🤷♂️~~
I'm getting the same problem suddenly. 25 calls over and over. Any updates?
@tt-marek Could anyone help us with this issue? 🙏 We can't use the framework because of it. We cannot develop projects without using a test network. 😉 Thanks!
OK, clearing the local storage helps. I had 200+ transactions in local storage (transactions
key). It looks like the framework tried to get a transaction receipt for each transaction, but the transaction hash was null
. Should we clean up transactions if they fail? I need to figure out why I had so many transactions in local storage. 🤔
@eshlox For now, at least, clearing the local storage stopped the error spamming, thank you
I'm sorry for a dumb question, but how do I clear the local storage?
It is solved, so i close that issue.
@mj426382 Pardon me, but it looks like it hasn't been solved in Rinkeby testnet, any hints on where should I look in order to solve this?
@OleksandrRabchuk Can you help me to reproduce it? Are you perhaps able to get to this error starting in an incognito mode or a fresh browser profile?