signer.signMessage(message) does nothing when MetaMask is locked — no popup, no error (even with WAGMI)

**Description:**Hi everyone,

I’m encountering a frustrating issue when trying to sign messages using MetaMask. Here’s the situation:

  • When MetaMask is locked, calling signer.signMessage(message) (via ethers.js or WAGMI) results in no popup, no error, and no response.

  • However, if I initiate a transaction or a connect request, MetaMask does show a popup asking me to unlock the wallet (enter password).

  • This proves that MetaMask can prompt the user to unlock, but for some reason, signMessage doesn’t trigger that behavior.

  • I also tried using WAGMI (v1 and v2) with signMessage, and the behavior is the same — nothing happens when MetaMask is locked.

  • From the frontend, I can’t detect whether MetaMask is locked or not. There’s no reliable method to check this state before calling signMessage.

Has anyone found a workaround for this? Is there a way to detect if MetaMask is locked before attempting to sign a message?

Any help or insights would be greatly appreciated!

Purpose: Make MetaMask better

Extension/Mobile/Both: Extension

Images/Attachments:

Hi @hanomag_13 If the wallet is locked, MetaMask will simply silently ignore or reject the signMessage request. This is for security and UX reasons.

The best and most reliable workaround is to manually trigger an “unlock” prompt by calling eth_requestAccounts right before you call signMessage.