dappuniversity / eth-todo-list

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

Uncaught TypeError: (intermediate value).toBigNumber is not a function #10

Open Rich2020 opened 3 years ago

Rich2020 commented 3 years ago

Not sure why I'm getting this. I've tried installing the specific web3 and truffle-contract (as listed in the package.json file).

truffle-contract.js:29 Uncaught TypeError: (intermediate value).toBigNumber is not a function
    at truffle-contract.js:29
    at Object.<anonymous> (truffle-contract.js:962)
    at Object.1../statuserror.js (truffle-contract.js:964)
    at o (truffle-contract.js:1)
    at truffle-contract.js:1
    at Object.2../contract.js (truffle-contract.js:967)
    at o (truffle-contract.js:1)
    at r (truffle-contract.js:1)
    at truffle-contract.js:1
jdohm commented 3 years ago

According to this comment https://github.com/trufflesuite/ganache-cli/issues/476#issuecomment-372534288 toBigNumber was renamed to toBN in version 1.0.0 of web3. To solve your problem use a compatible version of web3, for example 0.20.6.

kigh143 commented 3 years ago

Reinstalling web3@0.20.6 worked for me.

6str commented 2 years ago

0.20.6 worked for me too