Skip to content

Lesson 9 Error: TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider') #5577

Answered by alymurtazamemon
CryptoNube asked this question in Q&A
Discussion options

You must be logged in to vote

@CryptoNube Follow these steps;

  1. Install the ethers version 5; npm install -D ethers@^5 --force
  2. In the 00-deploy-mocks.js file fix typo here const { developmentChains } = require("../helper-hardhat-config")
  3. In the same file, fix typo here await deploy("VRFCoordinatorV2Mock",
  4. Now you will face error getContract is not a function so override hardhat ether with hardhat deploy ethers using this command npm install --save-dev @nomiclabs/hardhat-ethers@npm:hardhat-deploy-ethers --force

Make sure to use the --force flag whenever you see errors in command for conflicts.

Replies: 2 comments 3 replies

Comment options

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

@HarigovindM-G
Comment options

Answer selected by CryptoNube
Comment options

You must be logged in to vote
1 reply
@AditiNarkar
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
5 participants