ethereum-webpack-example-dapp
ethereum-webpack-example-dapp copied to clipboard
Cannot read property 'name' of undefined
main.js:110 Uncaught TypeError: Cannot read property 'name' of undefined
at renderTokenDetails (main.js:110)
at window.onload (main.js:68)
function renderTokenDetails() {
document.getElementById('token-name').innerHTML = _MyToken.MyToken.name();
document.getElementById('token-symbol').innerHTML = _MyToken.MyToken.symbol();
document.getElementById('total-supply').innerHTML = _MyToken.MyToken.totalSupply();
document.getElementById('version').innerHTML = _MyToken.MyToken.version();
}
_MyToken.
gets compiled by webpack with a model containing this as properties:
MyToken.sol:MyToken:Contract
MyToken.sol:tokenRecipient:Contract
web3:Web3
__proto__:Object
So it can't find the member MyToken
since it doesn't exist. Can you test your app. '
Also it was necessary to put pragma solidity ^0.4.4;
at the top of MyToken.sol
to get it to compile.