trufflesuite / drizzle

Reactive Ethereum dapp UI suite
906 stars 238 forks source link

Ethereum provider injected by MetaMask acts differently when injected to a Dapp vs an static-website or web2 app. #69

Closed alanarvelo closed 3 years ago

alanarvelo commented 4 years ago

eth_provider_error

Calling await ethereum.send('eth_chainId') — part of MetaMask's New API, see here — on the console of a regular website resolves nicely (left window), while calling it in a Drizzle project fails (right window). Used the same browser and the same MM account.

It seems this issue is originated by the interaction of web3.js with MM's new API. It can be replicated with this test repo by @cds-amal. When the script tags which import web3.js are uncommented, the same inpage.js:1 MetaMask - RPC Error: The method undefined does not exist/is not available error appears.

hantuzun commented 3 years ago

I wasn't able to reproduce this bug.