For whatever reason, when I attempt to set an instance of a contract in a javascript file, I get the following message in my console:
Uncaught TypeError: web3.eth.Contract is not a constructor
At first, I suspected I had a problem with properly setting my Web3 instance, but when I run:
console.log(web3);
The console shows that I the web3 instance is set.
I try and set my the contract instance using the following code:
const myContract = new web3.eth.Contract([//json array]);
Any tips for solving this?
npm ls web3
. For v0.x, remove thenew
and changeContract
with an upper-case C tocontract
with a lower-case c.