adrianmcli / truffle-react

⚛️ A boilerplate Truffle Box project with Create React App for rapid Ethereum Dapp development
46 stars 5 forks source link

localhost:3000 says "Failed to load web3, accounts, or contract. Check console for details" #15

Closed SvenMeyer closed 5 years ago

SvenMeyer commented 5 years ago
$ npm run start

localhost:3000 says "Failed to load web3, accounts, or contract. Check console for details"

Injected web3 detected.
App.js:28 TypeError: Cannot read property 'address' of undefined
    at Object._callee$ (getContractInstance.js:4)
    at tryCatch (runtime.js:62)
    at Generator.invoke [as _invoke] (runtime.js:296)
    at Generator.prototype.(:3000/anonymous function) [as next] (http://localhost:3000/static/js/bundle.js:63142:21)
    at step (registerServiceWorker.js:117)
    at registerServiceWorker.js:117

Is it a problem because MetaMask already injected an old 0.20 web3 version ? How is this handled best?

adrianmcli commented 5 years ago

Have you compiled and migrated your contracts? Make sure you do that inside the Truffle console:

compile
migrate --reset
SvenMeyer commented 5 years ago

yes, and making sure that Metamask is set to the right network and port solved the problem