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

ethers-providers 2.1.5 breaks getDefaultProvider() #51

Closed
GFJHogue opened this issue Oct 28, 2017 · 4 comments
Closed

ethers-providers 2.1.5 breaks getDefaultProvider() #51

GFJHogue opened this issue Oct 28, 2017 · 4 comments
Assignees
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@GFJHogue
Copy link

GFJHogue commented Oct 28, 2017

#45
The error:

/Users/gregory/repos/ethers-finicking/node_modules/ethers-providers/provider.js:487
    if (typeof(network.chainId) !== 'number') { throw new Error('invalid chainId'); }
                      ^

TypeError: Cannot read property 'chainId' of undefined
    at Function._legacyConstructor (/Users/gregory/repos/ethers-finicking/node_modules/ethers-providers/provider.js:487:23)
    at new InfuraProvider (/Users/gregory/repos/ethers-finicking/node_modules/ethers-providers/infura-provider.js:22:28)
    at Object.getDefaultProvider (/Users/gregory/repos/ethers-finicking/node_modules/ethers-providers/index.js:12:9)
    at Object.<anonymous> (/Users/gregory/repos/ethers-finicking/index.js:5:33)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)

How to reproduce:
npm i [email protected]

var providers = require('ethers-providers');
var provider = providers.getDefaultProvider();  // throws here
@ricmoo ricmoo self-assigned this Oct 28, 2017
@ricmoo ricmoo added the bug Verified to be an issue. label Oct 28, 2017
@ricmoo
Copy link
Member

ricmoo commented Oct 28, 2017

Fixed locally and updated test cases to check for this in the future.

Once local test cases and Travis-CI have verified it, I will publish to npm and update this issue.

@ricmoo
Copy link
Member

ricmoo commented Oct 28, 2017

Also note, as a work around for now:

var provider = providers.getDefaultProvider('homestead');

@GFJHogue
Copy link
Author

Cool, thanks! I'm just sitting on the previous version for now.

@ricmoo
Copy link
Member

ricmoo commented Oct 28, 2017

Passed all tests and published.

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

No branches or pull requests

2 participants