Skip to content

Lesson 9 Lottery: unable to deploy contracts, via deployment script. ERROR: TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider') #5656

Discussion options

You must be logged in to vote

@Glow-in-the-dark in your both deploy scripts you need to require ethers from hardhat add this below line in your both deploy scripts at top

const { ethers } = require("hardhat") 

and also you need to downgrade your ethers version so write below command in your terminal
yarn add ethers@5.4.0

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@Glow-in-the-dark
Comment options

Comment options

You must be logged in to vote
1 reply
@Glow-in-the-dark
Comment options

Answer selected by Glow-in-the-dark
Comment options

You must be logged in to vote
5 replies
@Glow-in-the-dark
Comment options

@HarshDev56
Comment options

@Glow-in-the-dark
Comment options

@Glow-in-the-dark
Comment options

@Glow-in-the-dark
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
3 participants