2

I am writing a Dapp. I'm not an expert. It works perfectly on Edge, Firefox, and Chrome (with MetaMask). But I get the following error on Opera when the cryptowallet is on but not synced:

{
  "error":{
    "code": -32503,
    "message": "wallet address undefined"
  },
  "id": 1,
  "jsonrpc": "2.0"
}

If I refresh the page, the error dissapears.

My web3.js component is as follows:

<pre>
import Web3 from 'web3';

let web3;

if (typeof window !== 'undefined' && window.web3 !== undefined) {

  const getProvider = async () => {
  await window.web3.currentProvider.enable();
  };
  getProvider();

  web3 = new Web3(window.web3.currentProvider);
  window.ethereum.autoRefreshOnNetworkChange = false;  
} else {
  const provider = new Web3.providers.HttpProvider(
    '//rinkeby.infura.io/v3/key'
  );
  web3 = new Web3(provider);
}
</pre>

I am using:

    "next-routes": "^1.4.2",
    "react": "^16.11.0",
    "react-dom": "^16.11.0",
    "semantic-ui-css": "^2.4.1",
    "semantic-ui-react": "^0.88.1",
    "solc": "^0.5.11",
    "tinify": "^1.6.0-beta.2",
    "truffle-hdwallet-provider": "^1.0.17",
    "web3": "^1.2.4"

Any help would be greatly appreciated.

2
  • 1
    Did you ever find an answer for this? We are having a lot of trouble having a consistent connection to Opera as well – FrozenKiwi Feb 13 '20 at 17:12
  • Same here, nearly a year later. What's up Opera? – Cliff Hall Oct 27 '20 at 18:48
0

Well i know its been a while, but i was having a similar problem, then i figure out that if i disable opera's cryprocurrency wallet, metamask works just fine. Just because of this i wasn't able to use eth network on some certain moments which i could benefit a lot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.