You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
Web3 Typescript definition on branch 1.0 doesn't contain "default export".
Context
Typescript version : 2.6.2
Converting ES2015(ES6) to ES5
After importing : import Web3 from 'web3';
Compilation Error
Module '"xxxx/node_modules/web3/index"' has no default export.
Update 1
After importing like this import Web3 = require('web3'); I got a compilation error :
error TS1202: Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from
"mod"', or another module format instead.
This error is due to Module mode from tsconfig which is ES6.
Update 2
I remove module mode from tsconfig and it works now.
eepstein, jacobappleton, catalsdevelop, hickscorp and aquaflamingo