I'm trying to use node.js with my smart contract for my app. As I've tried to convert from using the default
app.js set-up to
index.js set-up I've ran into this weird issue I can't fix.
It throws the error when trying to instantiate my .json file with truffle-contract.
App.contracts.Flip = TruffleContract(FlipArtifact); //at this line it goes to truffle-contract.js and throws this error:
var BigNumber = (new Web3()).toBigNumber(0).constructor;
TypeError: Web3 is not a constructor
I had the exact same thing but in my app.js where truffle puts it automatically and it was working fine.
Could someone please explain the difference between using truffle-contract in my app.js/client-side and my index.js/server-side. Thanks for any help.