question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"failed to check transaction hash" errors when using Rinkeby in "Getting Started" example

See original GitHub issue

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>
  )
}

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
eshloxcommented, Jan 18, 2022

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. 🤔

1reaction
devnobicommented, Jan 2, 2022

i have the same issue. it seems network specific

Read more comments on GitHub >

github_iconTop Results From Across the Web

"failed to check transaction hash" errors when using Rinkeby ...
"failed to check transaction hash" errors when using Rinkeby in ... I created a react app using the official "Getting started" example ....
Read more >
Browser spamming out "failed to check transaction hash
I'm trying out a simple React based web3 frontend app using https://usedapp.readthedocs.io/. However, even using the starting example they ...
Read more >
Web3 sending EIP-1559 Transaction Completed Successfully ...
I am able to send an EIP-1559 transaction through Rinkeby Testnet with Web3, the transaction completes without any trouble and I do get...
Read more >
Examples — Web3.py 5.31.3 documentation - Read the Docs
You can look up transactions using the web3.eth.get_transaction function. ... If no transaction for the given hash can be found, then this function...
Read more >
Debugging transactions in Ethereum. Part 1: The Long and ...
We'll start by exploring the data we get from etherscan. All of the transactions I'll use as examples were executed in Rinkeby, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found