PatrickAlphaC / ethers-simple-storage-fcc

88 stars 125 forks source link

chore: Troubleshooting ethers latest version's instability #67

Closed synacktraa closed 1 year ago

synacktraa commented 1 year ago

The newer versions of ethers appears to be unstable. It's throwing the following error, so downgrading the ethers version helped in solving this problem.

const provider = new ethers.providers.JsonRpcProvider(process.env.RPC_URL)
                                      ^

TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider')
PatrickAlphaC commented 1 year ago

Thank you!!

ezescigo commented 1 year ago

For current ethers.js version (6.5.x), the provider must be set as:

const provider = new ethers.JsonRpcProvider("http://127.0.0.1:7545");