|
| 1 | +# Wallet Troubleshooting Guide |
| 2 | + |
| 3 | +## Common Error: "Cannot redefine property: ethereum" |
| 4 | + |
| 5 | +### What causes this error? |
| 6 | + |
| 7 | +This error occurs when you have multiple wallet browser extensions installed (e.g., MetaMask, Phantom, Coinbase Wallet, etc.) that are competing to inject the `window.ethereum` object into the page. |
| 8 | + |
| 9 | +**Example error:** |
| 10 | + |
| 11 | +``` |
| 12 | +Runtime TypeError |
| 13 | +Cannot redefine property: ethereum |
| 14 | +``` |
| 15 | + |
| 16 | +### Solutions |
| 17 | + |
| 18 | +#### Option 1: Disable Conflicting Extensions (Recommended) |
| 19 | + |
| 20 | +1. Open your browser's extension manager: |
| 21 | + - **Chrome/Brave**: `chrome://extensions/` |
| 22 | + - **Firefox**: `about:addons` |
| 23 | + - **Edge**: `edge://extensions/` |
| 24 | + |
| 25 | +2. Disable all wallet extensions except the one you want to use |
| 26 | + - For Moonbeam, we recommend **MetaMask** or **Talisman** |
| 27 | + |
| 28 | +3. Reload the page |
| 29 | + |
| 30 | +#### Option 2: Use Different Browser Profiles |
| 31 | + |
| 32 | +1. Create separate browser profiles for different wallets: |
| 33 | + - **Chrome**: Settings → Users → Add person |
| 34 | + - **Firefox**: about:profiles |
| 35 | + - **Brave**: Settings → Create profile |
| 36 | + |
| 37 | +2. Install only one wallet per profile |
| 38 | + |
| 39 | +#### Option 3: Change Extension Load Order |
| 40 | + |
| 41 | +Some browsers allow you to change the order extensions load: |
| 42 | + |
| 43 | +1. Disable all wallet extensions |
| 44 | +2. Enable only your preferred wallet first |
| 45 | +3. Reload the page before enabling other extensions |
| 46 | + |
| 47 | +### Recommended Wallet Setup for Moonbeam |
| 48 | + |
| 49 | +**Primary wallet**: MetaMask or Talisman |
| 50 | + |
| 51 | +- Both have excellent Moonbeam support |
| 52 | +- Moonbeam is EVM-compatible, so MetaMask works natively |
| 53 | + |
| 54 | +**Network Configuration**: |
| 55 | + |
| 56 | +- **Network Name**: Moonbeam |
| 57 | +- **RPC URL**: `https://rpc.api.moonbeam.network` |
| 58 | +- **Chain ID**: `1284` |
| 59 | +- **Currency Symbol**: GLMR |
| 60 | +- **Block Explorer**: `https://moonscan.io` |
| 61 | + |
| 62 | +### For Developers |
| 63 | + |
| 64 | +If you encounter this error during development: |
| 65 | + |
| 66 | +1. **Check your extensions** - Disable unnecessary wallet extensions |
| 67 | +2. **Use a clean profile** - Test in a browser profile with only one wallet |
| 68 | +3. **Clear browser cache** - Sometimes cached scripts cause conflicts |
| 69 | +4. **Check console errors** - Look for which extension is causing the conflict |
| 70 | + |
| 71 | +### Still Having Issues? |
| 72 | + |
| 73 | +If you continue to experience problems: |
| 74 | + |
| 75 | +1. Try using a private/incognito window with extensions disabled |
| 76 | +2. Check if your wallet extension is up to date |
| 77 | +3. Verify your wallet supports the Moonbeam network (Chain ID: 1284) |
| 78 | +4. Contact support with your browser version and installed extensions list |
| 79 | + |
| 80 | +### Technical Details |
| 81 | + |
| 82 | +The error occurs because: |
| 83 | + |
| 84 | +- Each wallet extension tries to define `window.ethereum` using `Object.defineProperty()` |
| 85 | +- The property is marked as non-configurable |
| 86 | +- When a second extension tries to redefine it, JavaScript throws a TypeError |
| 87 | + |
| 88 | +This is a known limitation of the wallet injection pattern and affects all dapps, not just this one. |
0 commit comments