I always use following command to create a contract instance without any problem :
var contractInstance = new web3.eth.Contract(abi, '0xe1623AAf57fCbe260F022404C730ae32aebe39F6');
However, when currently I use this command, I receive following error :
TypeError: web3.eth.Contract is not a constructor
What is the reason ?
Best Answer
This is a generic javascript error: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Not_a_constructor
You call a 'new' on an object ('web3.eth.Contract') without a constructor.
It looks like your jumping from web3 versions.
In web3 < 1.0, this is the syntax (lowercase c, no 'new'):
In web3 1.0 (not ready for production yet) this is the syntax (uppercase C, 'new'):