Giter Site home page Giter Site logo

Comments (5)

kmturley avatar kmturley commented on July 23, 2024 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.

agrofcsik avatar agrofcsik commented on July 23, 2024

This seemed to solve my issue for now:
web3/web3.js#1155

from angular-truffle-box.

Ritin avatar Ritin commented on July 23, 2024

@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

from angular-truffle-box.

agrofcsik avatar agrofcsik commented on July 23, 2024

I ended up giving up and going with: angular4-truffle-starter-dapp which seems to work better.

from angular-truffle-box.

sergeym610 avatar sergeym610 commented on July 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.