首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >App.contracts.TodoList = TruffleContract(todoList)时出错

App.contracts.TodoList = TruffleContract(todoList)时出错
EN

Stack Overflow用户
提问于 2019-11-18 00:54:11
回答 1查看 579关注 0票数 0

在Windows 10环境下工作

来自windows 10上的web服务器的错误:

“”“

代码语言:javascript
复制
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)

“”“

错误中引用的代码:

代码语言:javascript
复制
'''
      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()
      },
'''
EN

回答 1

Stack Overflow用户

发布于 2019-11-18 02:43:51

已解决添加的var contract = required("truffle-contract");

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58902860

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档