smartcontractkit / full-blockchain-solidity-course-js

Learn Blockchain, Solidity, and Full Stack Web3 Development with Javascript
12.01k stars 2.91k forks source link

Lesson 7: "TypeError" by Ether latest versions #5154

Open juliancabmar opened 1 year ago

juliancabmar commented 1 year ago

Lesson / Section

Lesson 7 / Testing Fund Me

Video URL at current time

https://youtu.be/gyMwXuJrbJQ?t=40692

Operating System

Linux

Bug description:

ether latest versions drop a TypeError "Cannot read properties of undefined (reading 'JsonRpcProvider')". In my case ^6.0.2

Bug Solution:

Downgrade ethers to 5.7.2 version

venkatmanish commented 1 year ago

facing the issue even after degrading the ether version to 5.4.0 tried reinstalling but facing this issue code const provider = new ethers.providers.JsonRpcProvider( "HTTP://127.0.0.1:7545" ); Error TypeError: ethers.contractFactory is not a constructor

alymurtazamemon commented 1 year ago

@venkatmanish for this error TypeError: ethers.contractFactory is not a constructor you need to add new keyword before the ether.ContractFactory and it ContractFactory with capital C.