Open T-MacFbMa opened 5 years ago
At line 103 of file app/app.js, there is a statement window.web3 = web3;
with condition if (window.web3)
, comment out the condition line, then there would be always a defined web3.
I'm not sure whether this is the correct solution, it just works for me.
in app/app.js
you add
if (typeof web3 !== 'undefined') { web3 = new Web3(web3.currentProvider); } else { // set the provider you want from Web3.providers web3 = new Web3(new Web3.providers.HttpProvider("http://"+GETH_HOSTNAME+":"+GETH_RPCPORT); }
and delete var Web3 = require('web3');
Use this https://github.com/sthnaqvi/explorer
Google browser console "web3 is not defined”,It has been bothering me for a long time. Please tell me how to solve it. I have been trying to solve this problem,Looking forward to your reply!