Replies: 8 comments
-
Similar issue in our https://www.ustc.plus/ |
Beta Was this translation helpful? Give feedback.
-
We are also having this issue on https://nfts2me.com/app/ After some digging, we've seen that the issue comes from WalletConnect and wallets that use it, like Wagmi should be able to handle a delay from WalletConnect servers response and ignore its response until it responds, not affecting the rest of the connectors for wallets. It seems that the WS requests to No idea why it doesn't happen on the first connect, and only after a reconnection. We've disabled temporarily those wallets to make it work. |
Beta Was this translation helpful? Give feedback.
-
After latest viem and wagmi ("[email protected]") there are no petitions to relay.walletconnect.com ws, and thus, seems to be fixed. |
Beta Was this translation helpful? Give feedback.
-
Seems to be working fine to me now. If anyone is still experiencing this, please reply with a video so I can clearly see your reproduction steps. (If this comes up again in the future and this current issue is locked, feel free to create a new issue referencing this one.) |
Beta Was this translation helpful? Give feedback.
-
Can still reproduce in [email protected]
function App() {
useAccountEffect({
onConnect: (data) => console.log('useAccountEffect', data),
});
const config = useConfig();
useEffect(() => {
return watchAccount(config, {
onChange(data, prevData) {
console.log('debug watchAccount onChange', { prevData, data });
},
});
}, [config]);
screen-recording.webmtimestamps: |
Beta Was this translation helpful? Give feedback.
-
@lukaw3d looks like the video isn’t there |
Beta Was this translation helpful? Give feedback.
-
converted webm to mp4. Does this work https://github.com/user-attachments/assets/3c5b1240-ac60-4e13-bcea-4f24880188b4? b.mp4 |
Beta Was this translation helpful? Give feedback.
-
Thanks for attaching! Was able to reproduce. Since most folks likely have Site access set to "On all sites" (it's the default), not sure it's worth updating the behavior at this moment to accommodate "On click" as other features, like chain switching, also do not work with this setting. Let's treat this as more of a feature request for future support (converting to discussion). In the meantime, to patch if (
(prevData.status === 'reconnecting' ||
- (prevData.status === 'connecting' &&
- prevData.address === undefined)) &&
+ prevData.status === 'connecting') &&
data.status === 'connected'
) { |
Beta Was this translation helpful? Give feedback.
-
Check existing issues
Describe the bug
I'm trying to consistently listen to onConnect
but it isn't triggered when reloading the page by enabling metamask to run on the site
Link to Minimal Reproducible Example
https://stackblitz.com/edit/new-wagmi-tfvypz?file=src%2FApp.tsx
Steps To Reproduce
Added logging for useAccountEffect.onConnect conditions
wagmi/packages/react/src/hooks/useAccountEffect.ts
Lines 34 to 40 in 34df0c8
https://stackblitz.com/edit/new-wagmi-tfvypz?file=src%2FApp.tsx
open preview in new tab
First time connecting, click Injected: 🟢
Reload page: 🟢
Reload by enabling metamask to run on this site: 🔴
What Wagmi package(s) are you using?
wagmi
Wagmi Package(s) Version(s)
2.12.7
Viem Version
2.0.0
TypeScript Version
5.2.2
Anything else?
No response
Beta Was this translation helpful? Give feedback.
All reactions