-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Unresponsive window.ethereum.request() on SPA Applications (React & Vue) #19290
Comments
Hello, @re2005. Thanks for reporting! I will pass this on to the team. |
We noticed this issue as well |
There are typically no params passed into eth_requestAccounts. You would then use wallet_getPermissions to retrieve the accounts that the dapp already has permissions for. Does changing that help? |
Thanks @vandan. Doesn't return anything. Curious is that the But the method also tried: But no success. |
Cannot reproduce on Firefox 113.0.2 Page load requests/responses
EDIT:
EDIT2:
EDIT3: Minimum steps to reproduce:
Your first tab will respond to rpc calls as normal EDIT4: Relevant documentation for chrome prerender |
In summary so far:
Attempted fixes:
EDIT:
|
Slimmed down reproduction branch here video in slack (was too large for github) |
Chrome bug report submitted here. Will work on a fix meanwhile |
Workaround here |
Workaround merged |
Describe the bug
Seems that
SPA
(React, Vue) andMetamask
are having this issue.I've tested this behaivour on many websites and it seems consistent every time.
As example Uniswap built in
React
https://app.uniswap.org
On a previous connected session
Metamask
usually connected automatically if that site have already been approved.So lets say, if you call:
It will return your connected address in a Array format.
So far so good, the issue comes when you return to that same website, and than calling
await window.ethereum.request(...)
is not responsive anymore.Interesting is that same never happens on websites SSR, but mostly happens when is a SPA.
Steps to reproduce
https://app.uniswap.org
again.Uniswap
won't automatically connectConsole
and try yo fetch your accountsYou will notice that
Metamask
doesn't return anything.To fix, refresh the page, and it will work as expected
Error messages or log output
No response
Version
v10.30.4
Build type
None
Browser
Chrome
Operating system
MacOS
Hardware wallet
No response
Additional context
Screen.Recording.2023-05-25.at.16.40.23.mov
The text was updated successfully, but these errors were encountered: