Skip to content

TypeError: Cannot use 'in' operator to search for 'null' in undefined #6120

Answered by Adelani10
SamarthBagga asked this question in Q&A
Discussion options

You must be logged in to vote

In your /components/index.js file in the frontend, you're exporting "contractAddresses" but in your LotteryEntrance file, you're importing "contractAddress". Make it correlate and see if the issue persists. So it should be:-

import { abi, contractAddresses } from "../constants"

then

const raffleAddress = chainId in contractAddresses ? contractAddresses[chainId][0] : null

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@SamarthBagga
Comment options

@Adelani10
Comment options

@SamarthBagga
Comment options

@Adelani10
Comment options

Answer selected by SamarthBagga
@SamarthBagga
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants