Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google browser console "web3 is not defined" #60

Open
T-MacFbMa opened this issue Feb 20, 2019 · 3 comments
Open

Google browser console "web3 is not defined" #60

T-MacFbMa opened this issue Feb 20, 2019 · 3 comments

Comments

@T-MacFbMa
Copy link

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!

@maq128
Copy link

maq128 commented Feb 25, 2019

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.

@Amidama
Copy link

Amidama commented Feb 26, 2019

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');

@sthnaqvi
Copy link

sthnaqvi commented Mar 3, 2019

Use this
https://github.com/sthnaqvi/explorer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants