dappuniversity / token_sale

Code Your Own Cryptocurrency & ICO on Ethereum | Tutorial
406 stars 387 forks source link

Uncaught (in promise) TypeError: web3.fromWei(...).toNumber is not a function at app.js:77 #32

Closed danshinn89 closed 4 years ago

danshinn89 commented 4 years ago

toNumber() is not a function however this was working yesterday.

When I load my dev test page in the console I receive the following error:

Uncaught (in promise) TypeError: web3.fromWei(...).toNumber is not a function at app.js:77

` $('.token-price').html(web3.fromWei(App.tokenPrice, 'ether').toNumber());

I also made a change and added ` web3.utils.fromWei(App.tokenPrice, 'ether').toNumber());

However, this comes up as fromWei = undefinied

danshinn89 commented 4 years ago

Its a non issue I had to run truffle networks --clean