0

Working on Windows 10 Environment

Error from web server on windows 10:

'''

Failed to load resource: the server responded with a status of 404 (Not Found)

    app.js:56 Uncaught (in promise) ReferenceError: TruffleContract is not defined

    at Object.loadContract (app.js:56)

    at async Object.load (app.js:8)

'''

Code referenced in error:

'''
      loadContract: async () => {
        //var contract = require("truffle-contract");
        // Create a JavaScript version of the smart contract
        const todoList = await $.getJSON('vote.json')
        console.log(todoList)
        App.contracts.TodoList = TruffleContract(todoList)
        App.contracts.TodoList.setProvider(App.web3Provider)

        // Hydrate the smart contract with values from the blockchain
        App.todoList = await App.contracts.TodoList.deployed()
      },
'''
1
  • It's great that you followed up with your solution, but if you solved your problem, it's best to add your solution as an answer to your question instead of just adding a comment.
    – Derrick
    Nov 17, 2019 at 17:53

1 Answer 1

0

Solved added var contract = required("truffle-contract");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.