"TypeError: Unsupported chain" calling useContractFunction
See original GitHub issueHi Team
Great framework. Can’t seem to get past this one, no matter how I try. Fairly new to dApp design, but pretty sure I have everything setup right.
As soon as I call this,
const { state: buyTx, send: buyTest } = useContractFunction(contract, 'test', { transactionName: 'Buy test' });
buyTest();
I receive this via the:
useEffect(() => {
console.log(buyTx);
}, [buyTx]);
You can clearly see the
chainId=5
in the screenshot, this is Goerli and I can connect to my wallet OK to get this far.
I should also state, if I change my contract function to buy1
for example,. it crashes stating Unhandled Rejection (TypeError): contractWithSigner[functionName] is not a function
so I know it’s communicating to the very simple buy method I have settup in Solidity (currently returning 123 as a uint256).
Thanks in advance
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (3 by maintainers)
Top Results From Across the Web
"TypeError: Unsupported chain" calling useContractFunction ...
Hi Team Great framework. Can't seem to get past this one, no matter how I try. Fairly new to dApp design, but pretty...
Read more >How to Fix “Unsupported Chain ID” on PancakeSwap
In this guide, you'll learn what does "Unsupported Chain ID Error. Check your chain Id" mean on PancakeSwap and how to fix it....
Read more >"Unsupported chain ID" error message : r/pancakeswap - Reddit
Solved it by changing network to ethereum then back. When you are on metamask browser and pancake site (on phone ) bottom down...
Read more >Send React Web3 Transactions via MetaMask with useDapp
The useContractFunction hook takes in our contract instance, the name of the method that we'd like to call, and an options object.
Read more >The transaction declared chain ID 4, but the connected node ...
I checked every list and rinkeby chain Id was 4 but I get this error. ... the contract in python SimpleStorage = w3.eth.contract(abi=abi, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey Alex, thanks a lot for your workaround !
It wasn’t working at first on my end because the contract instance wasn’t connect to a signer, had to make some tweaks (also removed chainId as parameter and got it directly from useEthers)
I’ve been having the same issue since yesterday as well. Here’s a workaround that seems to fix the issue. Basically, all we need to do is add the chainId to the result of the contract function.