Skip to content

UI crash: A client-side exception has occurred #2382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sonytooo opened this issue Mar 5, 2025 · 2 comments
Open

UI crash: A client-side exception has occurred #2382

sonytooo opened this issue Mar 5, 2025 · 2 comments
Labels
bug Something isn't working new issue This issue has not been triaged by the core team yet

Comments

@sonytooo
Copy link

sonytooo commented Mar 5, 2025

Describe the bug
UI crashes with: Application error: a client-side exception has occurred (see the browser console for more information) after locking the connected extension (MetaMask, Rabby, Ambire...) while the supply token modal is opened

To Reproduce
Steps to reproduce the behavior:

  1. Connect a browser extension wallet
  2. Click on the 'Supply' button on some of the tokens
  3. Open the connected extension and lock it
  4. The AAVE app should be crashed

Expected behavior
The extension should get disconnected after locking the extension, and in the AAVE app, there should be a 'Connect Wallet' button to reconnect

Screenshots

Image Image

Desktop

  • OS: MacOS
  • Browser: Chrome
  • Version: 133.0.6943.127
@sonytooo sonytooo added bug Something isn't working new issue This issue has not been triaged by the core team yet labels Mar 5, 2025
@foodaka
Copy link
Collaborator

foodaka commented Mar 14, 2025

thanks for reporting, reproduced

@Ykcoo
Copy link

Ykcoo commented Apr 6, 2025

Bug Summary

You're experiencing a client-side crash in the Aave app when the connected wallet extension (MetaMask, Rabby, Ambire, etc.) is locked while the Supply modal is open.

Cause of the Issue

This crash happens because:

The Aave frontend tries to interact with the wallet (e.g., calling eth_accounts, eth_getBalance, etc.) while the wallet is locked.

The app doesn't handle the resulting error properly, causing it to crash instead of gracefully failing or prompting the user to reconnect.

Expected Behavior (as you described)

When the wallet is locked, the app should:

Detect that the wallet is disconnected or locked.

Automatically show a “Connect Wallet” button.

Not crash the UI.

Suggested Fix

To solve this in the Aave frontend, developers should:

  1. Listen to the disconnect event from the wallet

window.ethereum.on('disconnect', () => { setWalletConnected(false); // Update the UI accordingly });

  1. Wrap wallet calls with try-catch blocks

To prevent crashes when the wallet is locked:

try { const accounts = await window.ethereum.request({ method: 'eth_accounts' }); if (!accounts || accounts.length === 0) { // Wallet is locked or disconnected setWalletConnected(false); } } catch (error) { console.error("Wallet error:", error); // Show a fallback UI or toast notification }

  1. Optional – Close the modal or redirect to the dashboard if the wallet gets disconnected mid-action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new issue This issue has not been triaged by the core team yet
Projects
None yet
Development

No branches or pull requests

3 participants