dappuniversity / eth-todo-list

Blockchain Todo App Tutorial Powered by Ethereum Smart Contracts
549 stars 549 forks source link

uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'TodoList') #43

Closed shubhamsah-ss closed 1 year ago

shubhamsah-ss commented 1 year ago

My code: loadContract: async () => { // Create a JavaScript version of the smart contract const todoList = await $.getJSON('TodoList.json') 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()

},

Error its showing: Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'TodoList')