Skip to content

Lesson 7 log("Mocks deployed!") TypeError: Cannot read properties of undefined (reading 'indexOf') #2462

Answered by RoboCrypter
JuniorSua asked this question in Q&A
Discussion options

You must be logged in to vote

@JuniorSua : Correct the following mistakes, I'm listing below in your mocks deploy script :

  1. Correct the deployments and getNamedAccounts spelling in module.exports :
module.exports = async ({ getNameAccounts, deloyments }) => {
    const { deploy, log } = deployments
    const { deployer } = await getNameAccounts()
  1. And also remove the extra coma from module.exports.tags : module.exports.tags = ["all", , "mocks"]

Corrections should be like this :

  • module.exports = async ({ getNamedAccounts, deployments }) => {
        const { deploy, log } = deployments
        const { deployer } = await getNamedAccounts()
        const chainId = network.config.chainId
    
  • Also define chainId in your module.exports

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@RoboCrypter
Comment options

@JuniorSua
Comment options

Answer selected by JuniorSua
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