-
ChainId is returning an error saying it is 'undefined.' When I ran the code 15 mins ago, it was working absolutely fine. I literally didn't touch the code on this end, and started getting this error all of a sudden... How can I mitigate it? const {chainId: chainIdHex, isWeb3Enabled } = useMoralis()
const chainId2 = parseInt(chainIdHex)
console.log(`Chain ID is ${chainId2}`)
const raffleAddress= chainId2 in contractAddresses ? contractAddresses[chainId][0] : null Error Code:
|
Beta Was this translation helpful? Give feedback.
Answered by
krakxn
Jul 7, 2022
Replies: 2 comments 14 replies
-
Which lesson is this precisely? |
Beta Was this translation helpful? Give feedback.
10 replies
Answer selected by
harshuo2
-
@harshuo2 you should console log the chainId and contract address, it looks like one is NaN and the other is undefined. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Which lesson is this precisely?