<
 
 
 
 
×
>
hide You are viewing an archived web page, collected at the request of Ethereum Foundation using Archive-It. This page was captured on 04:00:32 Jun 25, 2021 , and is part of the Community collection. The information on this web page may be out of date. See All versions of this archived page. Loading media information

Angular 5 and web3.js

aleksa_jovanovicaleksa_jovanovic Member Posts: 1
Hi all,

I recently started developing a small game on the blockchain in order to further my understanding.

I have written the smart contract portion of the game and I am now working on the web portion. I am using angular 5 and I cant seem to import the web3 library and instantiate it. I've tried:

1. import * as Web3 from 'web3'; then I get the error "Cannot use 'new' with an expression whose type lacks a call or construct signature."
2. import Web3 from 'web3'; then I get the error "web3_1.default is not a constructor"

I suspect the problem has to do with the typescript definitions provided by npm. I have read everything I could find on Google so any help would be greatly appreciated.

Comments

Sign In or Register to comment.