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.givenProvider is undefined #1289

Closed
brunobar79 opened this issue Jan 22, 2020 · 1 comment
Closed

Web3.givenProvider is undefined #1289

brunobar79 opened this issue Jan 22, 2020 · 1 comment
Labels
P1 type-bug Something isn't working

Comments

@brunobar79
Copy link
Contributor

This is happening with Web3 1.2+
I was able to reproduce it on spankchain.

Screen Shot 2020-01-22 at 4 56 06 PM

@brunobar79 brunobar79 added type-bug Something isn't working blocker P1 labels Jan 22, 2020
@brunobar79
Copy link
Contributor Author

From what I can tell, we won't be able to fix this: https://github.com/ethereum/web3.js/blob/a5e832fc20088cf4c4e916bc0ec3107ceb4428d0/packages/web3-core-requestmanager/src/givenProvider.js#L37

It looks like the givenProvider detection is happening as early as the library loads, what makes impossible for mobile to get the provider ready that early.

I guess the only thing we can do is to discourage the usage of Web3.givenProvider, and use window.ethereum instead.

This should be mentioned in #340

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 type-bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant