dappuniversity / eth-todo-list

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

NPM issue when running web client #7

Open Dinnerspy opened 3 years ago

Dinnerspy commented 3 years ago

When running the demo using npm run dev. I get the following errors. Uncaught TyoeError: Web3 is not a constructor on line 29 of the node dependency truffle-contract.js and Uncaught (in promise) Reference Error: Web3 is not defined at object.loadweb3(appjs:16). I have not modified any of the code. I installed it by typing git clone https://github.com/dappuniversity/eth-todo-list.git. then I type npm install followed by npm run dev.

Dinnerspy commented 3 years ago

I was able to resolve the issue using a web3 workaround. now i cant seem to get the tasks to show in the webpage.

i001962 commented 3 years ago

I think this has something to do with metamask removing window.web3 but I haven't figured out the workaround. @Dinnerspy would you mind posting your workaround? I seem to be stuck at about the same place you are...

Dinnerspy commented 3 years ago

@i001962 adding this https://www.npmjs.com/package/@metamask/legacy-web3 to the node modules along with adding this chrome extension https://github.com/MetaMask/legacy-web3-extension with the current metamask.

Dinnerspy commented 3 years ago

@i001962 Let me know if you can figure out why transactions with long length text wont be created as events.

i001962 commented 3 years ago

@Dinnerspy I ended up installing "@truffle/contract": "^4.3.9". Still working through some issues and haven't fully committed to solving this... I may just move on to something else

jordie9669 commented 3 years ago

Also getting the same error