Modal stops working after site refresh #5586
Unanswered
Aspect26
asked this question in
Developer Support
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I open my page, I can open the appkit modal via
<appkit-button>
just fine, I can connect my metamask wallet just fine, and generally, everything looks to work just fine.However, If I do not disconnect and refresh the page (or close the page and open it again) everything gets broken. The button correctly displays my wallet, I can open the modal, but no action in the modal works. If I click disconnect I get message Failed to disconnect. If I try to switch network, I get Switch declined message. When I had SIWE included (not part of minimal reproducible example), signing messages failed with similar error.
There is no error in the console when I try the disconnect or switch network, however when signing a message (for SIWE) errored, I got the following error in console:
SIWXUtil.js:112 SWIXUtil:requestSignMessage Error: WagmiAdapter:signMessage - Sign message failed
After some investigation I did myself, it seems there is some error in wagmi adapter's wagmiConfig's state. The connector in connections looks like some incorrectly initialized object (https://ibb.co/cLKRn9j) as opposed to the object which is there before refreshing the page (https://ibb.co/vDQP8Fv).
I created minimal reproducible example here - https://github.com/Aspect26/wc-angular
How to reproduce:
ng serve
(will have to install dependencies first), openlocalhost:4200
and connect via the appkit button)NOT
disconnectRelevant code is in
WalletConnectModalService
(you need to set project-id inprojectId
variable here). The service is injected byAppComponent
.My environment is: Ubuntu 24.10, Chrome browser, MetaMask wallet
Beta Was this translation helpful? Give feedback.
All reactions