Comments (5)
when changing from:
import Web3 from 'web3';
to:
import * as Web3 from 'web3';
I get a different error afterwards:
truffle_contract_1.default is not a function
Which seems to be fixed by changing the line:
import {default as contract} from 'truffle-contract';
to:
const contract = require('truffle-contract');
from angular-truffle-box.
This seemed to solve my issue for now:
web3/web3.js#1155
from angular-truffle-box.
@agrofcsik the solution at https://github.com/ethereum/web3.js/issues/1155
did not work for me
import Web3 from 'web3';
gives the above mentioned (TypeError: web3_1.default is not a constructor)
import * as Web3 from 'web3';
webpack compile Fails
+-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| `-- [email protected]
`-- [email protected]
@angular/[email protected]
@angular/[email protected]
from angular-truffle-box.
I ended up giving up and going with: angular4-truffle-starter-dapp which seems to work better.
from angular-truffle-box.
ERROR TypeError: web3_1.default is not a constructor
This problem was made me crazy a few days.
I used "npm install web3 --save" command and import Web3 from 'web3';
So, the error occurred!
In my experience, I removed "import Web3 from 'web3';" and added new lines like
"declare let Web3: any;
declare let web3;"
It works correctly for me.
I hope that this is correct resolve.
Thanks
from angular-truffle-box.
Related Issues (20)
- Trouble unboxing package HOT 7
- TypeChain HOT 10
- Error HOT 4
- Create Dockerfile HOT 1
- web3_1.default is not a constructor HOT 18
- Event example HOT 2
- Use Ganache instead of TestRPC HOT 4
- Updating angular cli to version 1.6.2 causes karma tests to fail HOT 2
- When try to unbox, can't find Python executable even it is already installed HOT 4
- Error: Contract has not been deployed to detected network (network/artifact mismatch) HOT 2
- Upgrade to angular 6.0 HOT 2
- Having trouble unboxing this box HOT 2
- Update to Angular 7 HOT 1
- accounts balance happend but dont refresh on ganache or metamask HOT 5
- Remove node-gyp subdependencies
- Revisit web3 integration
- truffle unbox Quintor/angular-truffle-box command problems HOT 3
- this truffle cant work with Metamask since this year (Chrome) HOT 1
- Unbox failing on windows 10 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-truffle-box.