I'm writing my own application that follows a similar form to the Truffle Pet Shop.

I have the following code in my app.js:

initContracts: function(){
    $.getJSON('Greeter.json', function(data) {
        var GreeterArtifact = data;
        App.contracts.Greeter = TruffleContract(GreeterArtifact)
    return App.sayHello();

I'm getting the following console error:

Uncaught ReferenceError: TruffleContract is not defined
    at Object.success (app.js:34)

The only difference between me and the Truffle Pet Shop is that they have a truffle-contract.js file in their js folder. I installed truffle-contract with npm and it's listed in my package.json.

Any idea why I'm getting this error?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.