-
Notifications
You must be signed in to change notification settings - Fork 552
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
App.js not running properly on the client side #21
Comments
Okay, i finally found a way of going through the issue i posted above by following issue #19 updates posted by @ahampriyanshur. But then again, i have run into another issue of ethereum not defined |
I am also facing the same issue. any help or solutions are appreciated. |
@iamthekavita
|
|
thanks! This worked for me. |
Goodday, Web3 devs and learners, I am having this persistent issue for some days now. Each time i'm following up the tutorial on Intro To Ethereum programming [Full Course] at about 7hrs:14mins.
I tried running the app.js file by doing npm run dev. It runs smooth but returns this error on inspection
Uncaught (in promise) TypeError: Web3 is not a constructor
at Object.loadWeb3 (bundle.js:85130:20)
at Object.load (bundle.js:85122:19)
at bundle.js:85167:13
at dispatch (jquery.min.js:3:12444)
at r.handle (jquery.min.js:3:9173)
Note: The bundle.js is actually a browserified version of app.js, since require() doesn't apply smoothly to client-side JS, i had to create a browserified version of my original app.js file by running the command browserify app.js -o bundle.js
But, on clicking on the resulting error above, i noticed that the error is actually centered on any line with web3 as shown below
App = {
load: async () => {
await App.loadWeb3()
await App.loadAccount()
},
// https://medium.com/metamask/https-medium-com-metamask-breaking-change-
loadWeb3: async () => {
if (typeof web3 !== 'undefined') {
App.web3Provider = web3.currentProvider
web3 = new Web3(web3.currentProvider)
These errors were about 3 before now, but i've been able to debug the other 2, remaining this, and would appreciate a solution or input
The text was updated successfully, but these errors were encountered: