I am following the Building your First Blockchain tutorial(https://www.youtube.com/watch?v=coQ5dg8wM2o&t=494s).
I have the following in my index.html:
<script src="https://cdn.jsdelivr.net/gh/ethereum/web3.js/dist/web3.min.js"></script>
<script src="vendor/truffle-contract/dist/truffle-contract.js"></script>
<script src="app.js"></script>
And when I open my index.html page I get the following error on console:
(intermediate value).toBigNumber is not a function
at truffle-contract.js:16802
at Object.<anonymous> (truffle-contract.js:17735)
It happens in truffle-contract.js node_modules package code:
var BigNumber = (new Web3()).toBigNumber(0).constructor;
It seems like that web3.min.js file does not support "toBigNumber" function. I do have the following dependency in package-lock.json:
"dependencies": {
"web3": {
"version": "0.20.6",
"resolved": "https://registry.npmjs.org/web3/-/web3-0.20.6.tgz",
"integrity": "sha1-PpcwauAk+yThCj11yIQwJWIhUSA=",
"dev": true,
"requires": {
"bignumber.js": "git+https://github.com/frozeman/bignumber.js-nolookahead.git",
"crypto-js": "^3.1.4",
"utf8": "^2.1.1",
"xhr2": "*",
"xmlhttprequest": "*"
}
}
}
Not sure where I can get the right web3.min.js file that supports the toBigNumber function