Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error TS2305: Module ''bn.js'' has no exported member 'BigNumber' #1596

Closed
leoplct opened this issue Apr 29, 2018 · 5 comments
Closed

error TS2305: Module ''bn.js'' has no exported member 'BigNumber' #1596

leoplct opened this issue Apr 29, 2018 · 5 comments
Assignees
Labels

Comments

@leoplct
Copy link

leoplct commented Apr 29, 2018

I am following this tutorial: https://0xproject.com/wiki#Create,-Validate,-Fill-Order

When I run

yarn run order_actions

I get this error

yarn run v1.6.0
$ run-s build tutorial:order_actions
$ tsc
node_modules/web3/types.d.ts(1,10): error TS2305: Module ''bn.js'' has no exported member 'BigNumber'.
node_modules/web3/types.d.ts(1,27): error TS2497: Module ''bn.js'' resolves to a non-module entity and cannot be imported using this construct.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "build" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

package.json

{
    "name": "0xStarterProject",
    "version": "0.1.0",
    "description": "",
    "scripts": {
        "order_actions": "run-s build tutorial:order_actions"
....
"dependencies": {
        "0x.js": "0.36.3",
        "@0xproject/connect": "^0.6.10",
        "@0xproject/tslint-config": "^0.4.16",
        "@0xproject/utils": "^0.5.2",
        "@types/underscore": "^1.8.8",
        "body-parser": "^1.18.2",
        "express": "^4.16.2",
        "web3": "^1.0.0-beta.34",
        "websocket": "^1.0.25"
    }
@freeatnet
Copy link

Looks like this was solved here: 0xProject/0x-starter-project#11 (comment)

@emkman
Copy link

emkman commented Jun 18, 2018

@freeatnet It isn't clear to me what the resolution is besides trying to change web3 version or delete some relative folder. Can you elaborate? I am using "web3": "^1.0.0-beta.34" and "@types/web3": "^1.0.0"

@emkman
Copy link

emkman commented Jun 18, 2018

Following up, it looks like the suggestion is to delete the type definitions from node_modules/web3. This solves the error but is just a workaround and not a solution correct? Is the ultimate goal to update the type definitions in the web3 package?

@freeatnet
Copy link

@emkman There are now proper type definitions available through DefinitelyTyped (DefinitelyTyped/DefinitelyTyped#26031), along with an guide to using them here: #1658 (comment). There's also a request to remove type definitions from web3.js itself: #1658.

@nivida
Copy link
Contributor

nivida commented Mar 25, 2019

Version 0.20.x got his last maintenance release with v0.20.7. Please update your code to the latest 1.0 version of Web3.js. Further details about the current project state are explained in the release announcement of version 1.0.0-beta.38.

@nivida nivida closed this as completed Mar 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants