MetaMask - RPC Error: Permissions request already pending, in Angular 10
Asked Answered
R

3

6

I have integrated the MetaMask with Angular and while opening up the MetaMask extension from the code I am getting this error.

Following is my code for opening up the extension. I am calling this function on a click to open MetaMask where its giving that error

MetaMask - RPC Error: Permissions request already pending; please wait. {code: -32002, message: "Permissions request already pending; please wait."}

ethEnabled(template?): any
  {
    if ((window as any).web3)
    {
      (window as any).web3 = new Web3((window as any).web3.currentProvider);
      (window as any).ethereum.enable();
      console.log((window as any).ethereum.enable());

    }
    else
    {
      this.modalRef = this.modalService.show(template);
    }
  }

Rhinoceros answered 24/11, 2020 at 5:34 Comment(0)
C
12

This error is actually expected; it happens when you've already submitted a permissions request, but the user has either not logged into MetaMask or not granted permissions to your app.

If the user logs into MetaMask and accepts the permissions request, this error will not occur anymore.

This is explained in the docs, where it says You should always disable the "connect" button while the connection request is pending (otherwise this error occurs).

Here is one way to handle this:

  • Disable the button while the request is pending
  • If the user is not connected after a certain waiting period (10-20 seconds, perhaps?), show a message under the button requesting the user to complete the MetaMask connection.

There is more information and a nice example in their docs here.

Countermove answered 16/1, 2021 at 4:43 Comment(0)
M
0

Describe the bug

When I close the unlock wallet popup while requesting eth accounts, I'm not getting any result. And when I request eth accounts again, I'm getting the following error MetaMask - RPC Error: Already processing eth_requestAccounts. Please wait.

Steps to reproduce (REQUIRED)

 window.web3 = new Web3(window.ethereum)
 const account = await window.ethereum.request({
      method: 'eth_requestAccounts',
 })

Have wallet locked Trigger request Close unlock popup Trigger request again Expected behavior

Receive error with specific code to know that unlock wallet has been closed as well as the transaction to be discharged from the processing pipe.

Meghan answered 24/1, 2023 at 6:24 Comment(0)
N
-1

Clear your internet cache, temp files etc.

Natashianatassia answered 21/4, 2021 at 5:3 Comment(2)
As part of your answer, you should provide an example of how to accomplish "Clear your internet cache, temp files etc.".Gunsmith
This answer says nothingPunk

© 2022 - 2024 — McMap. All rights reserved.