The `<w3m-button/>` doesn't restore session after page reload in Next.js 14.
skibitsky opened this issue · comments
Gleb Skibitsky commented
Describe the bug
The <w3m-button/>
doesn't restore session after page reload in Next.js 14.
The workaround is to disable enableEmail
in the WAGMI config.
SDK Version (if relevant)
- @web3modal/siwe: ^4.1.5
- @web3modal/wagmi: ^4.1.5
- viem: ^2.9.8,
- wagmi: ^2.5.18
- next: 14.1.4,
To Reproduce
Steps to reproduce the behavior:
- Go to https://unity-web3modal-wagmi-gb75xhybh-skibitsky.vercel.app/
- Click on
Connect Wallet
in theReact
section - Connect a wallet
- Sign message. Confirm it works.
- Close the tab. Open the same url again.
- After the page is loaded, you will most likely see the
Account
button instead ofConnect Wallet
, as expected. However, after a few seconds, the button will turn intoConnect Wallet
. - However, the Sign Message button remains active and can still sign messages.
Expected behavior
After page reload, the Account
button is shown instead of Connect Wallet
.
Desktop (please complete the following information):
- OS: macOS
- Browser Arc, Safari
- Version Arc 1.37.0, Safari 17.4.1
Additional context
Add any other context about the problem here.
Linear commented
Glitch commented
Van Nam Phuc commented
Same issue with React Native. I don't know why but web3modal site currently also have this bug