dappuniversity / eth-todo-list

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

web3.min.js:1 Uncaught (in promise) Error: invalid address #27

Open dguhanus opened 2 years ago

dguhanus commented 2 years ago

Hi Gregory, Thank you for your wonderful explanation. I have successfully the migrated the contract into Ganache. I am able to load the smart contract after "npm run dev". But when I enter any text into the textbox, it is throwing an error: web3.min.js:1 Uncaught (in promise) Error: invalid address web3.min.js:1 at u (web3.min.js:1). Here are the screenshots Eth_TodoLis_1 Eth_TodoLis_2

lucasribeiro-dev commented 2 years ago

Try out this in your function "load" in the last line

    web3.eth.defaultAccount = App.account;

Will be like this

  load: async () => {
    await App.loadWeb3();
    await App.loadAccount();
    await App.loadContract();
    await App.render();
    web3.eth.defaultAccount = App.account;
  },

It worked for me

reference: https://ethereum.stackexchange.com/questions/1740/why-does-mist-throw-uncaught-invalid-address