I have a question. The other day I was able to execute the code just fine (setting data). When I clicked on the “Add Data” button in the People Dapp, MetaMask popped up and allowed me to confirm the transaction (for 1 ether).
Today, however, when I tried to do it again, Metamask fails to pop up to confirm the transaction. It looks like I am connected to Ganache, I migrated the contract to Ganache, Metamask shows that I am connected—everything appears to be the same as yesterday.
Any thoughts? I can’t figure out why it was working perfectly yesterday, but it is not working today. I didn’t alter any of the code. Why might Metamask be unresponsive to a click on the “Add Data” button (but it worked fine the other day)?
Thanks!
UPDATE1: I took a look at the console, and I am getting the following error:
Uncaught TypeError: Cannot read property ‘toWei’ of undefined
at HTMLButtonElement.inputData (main.js:19)
at HTMLButtonElement.dispatch (jquery-3.4.1.min.js:2)
at HTMLButtonElement.v.handle (jquery-3.4.1.min.js:2)
UPDATE 2: I seem to have fixed the issue. I started from scratch and was having a weird issue where the MetaMask transaction was now popping up to confirm transaction of 1 ether, when I know the javascript file was not requesting any value attached to the transaction (because I hadn’t gotten to that part of the lesson yet. Solution: I went into my Chrome browser and simply cleared the cache. That seems to have worked.