WalletConnect / web3modal

A single Web3 provider solution for all Wallets

Home Page:https://web3modal.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The `<w3m-button/>` doesn't restore session after page reload in Next.js 14.

skibitsky opened this issue · comments

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:

  1. Go to https://unity-web3modal-wagmi-gb75xhybh-skibitsky.vercel.app/
  2. Click on Connect Wallet in the React section
  3. Connect a wallet
  4. Sign message. Confirm it works.
  5. Close the tab. Open the same url again.
  6. After the page is loaded, you will most likely see the Account button instead of Connect Wallet, as expected. However, after a few seconds, the button will turn into Connect Wallet.
  7. 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.

Same issue with React Native. I don't know why but web3modal site currently also have this bug