Lesson 9 Error: TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider') #5577
-
|
At: https://youtu.be/gyMwXuJrbJQ?t=55193 When I
After searching and reading about this issue in the discussions, it is suggested that ethers@^6.0.0 has problems. Specifically,
After doing the above, I now get an error:
I went a step further and removed all dependencies and replaced them with the same versions as the instructor's repo. (as per comment: #4809 (reply in thread)) I still got the error:
I then tried to migrate to hardhat-toolbox. (as per comment #5426 (reply in thread))
...and, when using an older ethers (ethers@^5.0,0) with the hardhat-toolbox dependencies, I get this error
The current state of my project is using the hardhat-toolbox dependencies with [email protected] |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
@CryptoNube Follow these steps;
Make sure to use the |
Beta Was this translation helpful? Give feedback.
-
|
@alymurtazamemon I did step 1 and 4 in your answer. Mock got deployed but am getting an error package.json file |
Beta Was this translation helpful? Give feedback.
@CryptoNube Follow these steps;
npm install -D ethers@^5 --force00-deploy-mocks.jsfile fix typo hereconst { developmentChains } = require("../helper-hardhat-config")await deploy("VRFCoordinatorV2Mock",getContract is not a functionso override hardhat ether with hardhat deploy ethers using this commandnpm install --save-dev @nomiclabs/hardhat-ethers@npm:hardhat-deploy-ethers --forceMake sure to use the
--forceflag whenever you see errors in command for conflicts.