Web3.js: 1.0 beta.27 not working for typescript "resolves to a non-module entity"

Created on 28 Dec 2017  路  6Comments  路  Source: ChainSafe/web3.js

I am currently upgrading to latest 1.0 beta.27,

import { default as Web3 } from 'web3'; doesn't work . gives a error below

/node_modules/web3/index"' resolves to a non-module entity and cannot be imported using this construct.

All 6 comments

Possible to pass the compile process:

var Web3 = require('web3');

This way Web3 lost type definitions though, even there is a index.d.ts inside node_modules/web3.

@helxsz this should be fixed after the PR #2000

@nivida the problem wasn't fixed, I'm still not able to use import Web3 from 'web3'.

@jeansouza Yes, there is a similar TS issue. I will fix and release it asap. I apologize for the troubles.

@nivida thank you very much! =]

The readme file got updated and explains the usage of the Web3.js lib in a commonjs environment.

Was this page helpful?
0 / 5 - 0 ratings