-
Notifications
You must be signed in to change notification settings - Fork 37
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
web3_1.default is not a constructor #26
Comments
This seems related to this error: |
@kmturley: Thanks for your response!
Do you have any ideas what may cause this issue? |
I think it's also related to the version of Web3. I was getting issues with: but not with: You can downgrade using the command: |
Also there are other gotchas with the tools, so reset everything when testing:
|
https://github.com/Quintor/angular-truffle-box/blob/master/tsconfig.json#L10 This line is what fixed the original issue for me. If anyone has a current configuration in which this error occurs, let me know. Downgrading web3 should not be necessary, but is indeed an approach. |
Facing the this exact error with a fresh download of this truffle box. |
@Muhammad-Altabba Could you let me know versions of: node, npm, angular-cli, truffle? |
Kindly find bellow:
|
Thank you! And web3 version? The error occurring is exactly the same, with web3, rather than some other package? |
I am facing the issue while using the current fresh version of this box. So web3 version is the same mentioned at current package.json: |
I take it you've used |
Unfortunately, both |
Does it also occur when using |
It works with However, I noticed at at package-lock.json that web3 required version for the project is 1.0.0-beta.33:
But truffle-contract depends on version 0.20.6 of web3:
|
Yep. The difference between web 1.x and 0.20 is by design. Does This issue looks a lot like #31, which I resolved in #33. Does it work if you change the module system and/or target in https://github.com/Quintor/angular-truffle-box/blob/master/src/tsconfig.app.json. Also, what browser are you using? |
@Muhammad-Altabba Above pull request should have fixed it. If not, could you let me know? |
ERROR TypeError: web3_1.default is not a constructor It works correctly for me. |
Hi,
I received the error message: "web3_1.default is not a constructor"
The project dependencies are:
angular 5,
"web3": "^1.0.0-beta.26",
"@angular/cli": "^1.6.7"
I didn't modified the web3.service.ts as its original, however, the app detected metamask is installed and throw the error when reach below line in the bootstrapWeb3()
this.web3 = new Web3(window.web3.currentProvider);
Please help!!!
The text was updated successfully, but these errors were encountered: