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

web3.js 1.0.0-beta.41 web3.eth.net is undefined #2267

Closed
7Ds7 opened this issue Jan 29, 2019 · 3 comments
Closed

web3.js 1.0.0-beta.41 web3.eth.net is undefined #2267

7Ds7 opened this issue Jan 29, 2019 · 3 comments
Labels
Needs Clarification Requires additional input

Comments

@7Ds7
Copy link

7Ds7 commented Jan 29, 2019

Expected behavior

web3.eth.net should not be undefined

Actual behavior

web3.eth.net is undefined

Steps to reproduce the behavior

  1. [First step]
    Bundle one of the build files in web3.js/packages/web3/dist (ex: using browserify)

  2. [Second step]
    Include on the page

  3. [and so on...]
    web3.eth.net is undefined and per documentation it should not https://web3js.readthedocs.io/en/1.0/web3-eth-net.html

@nivida
Copy link
Contributor

nivida commented Jan 31, 2019

Thanks for submitting this issue!
Will test it on Monday it should work but I tested it with webpack.

@nivida nivida added the Needs Clarification Requires additional input label Jan 31, 2019
@nivida
Copy link
Contributor

nivida commented Feb 4, 2019

I've created the bundle with webpack and console.log(web3.eth.net) returns the expected Network class. Be sure browserify is using the umd bundle of Web3.js. Because it isn't an issue of Web3.js itself do I close this issue now.

@nivida nivida closed this as completed Feb 4, 2019
@agnelvishal
Copy link

I was trying to access the Network ID to find if Metamask account in the browser is in the testnet or mainet. I tried

web3.eth.net.getNetworkType()
.then(console.log);

but web3.eth.net was undefined.
web3.version.network worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Clarification Requires additional input
Projects
None yet
Development

No branches or pull requests

3 participants