Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

393
Visualizações
I got error on Metamask 'Unchecked runtime.lastError: Could not establish connection'

I use svelte to create Web3 app and got some error

1.I already added web3.js cdn on my index.html

<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>

2.this is my script on .svelte file to connect the Metamask Wallet

function connectWallet(){
if(window.ethereum){
  window.web3 = new Web3(ethereum);
  window.ethereum.enable();
  metamaskConnected = window.ethereum.isConnected();
  web3.eth.getAccounts(function(error, accounts) {
    WalletAddress = accounts
    console.log(error)
  })
}

}

  1. And when i open my website on the broser (Brave) for the first time i got this error

    Unchecked runtime.lastError: Could not establish connection

and the script not working

  1. I have to refresh my page and then the error disappear so my code works normally

Could you give me some suggestion, Thank you very much

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I got the exact same issue on my dapp, I've to investigate more but it looks like it happpen on any Chromium browser and ONLY IF clicking the dapp url open the browser in the same time.

Pretty weird bug, probably a problem between the communication of Metamask and Chromium browsers

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda