MetaMask / MetaMask/metamask-extension
[Bug]: Cannot read properties of undefined (reading 'startsWith') on KONET custom network
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
### Describe the bug
I encountered an error when using MetaMask with a custom network (KONET).
When switching to the KONET network or accessing the wallet, MetaMask fails to load and shows an error screen.
The wallet information cannot be displayed.
### Expected behavior
MetaMask should load normally and display account information without errors.
### Screenshots/Recordings
### Steps to reproduce
1. Add KONET custom network (Chain ID: 17217)
2. Switch to the KONET network
3. Open MetaMask or try to access wallet
4. Error appears
### Error messages or log output
```shell
TypeError: Cannot read properties of undefined (reading 'startsWith')
at isEVMAccountForSend
at Array.forEach
```
### Where was this bug found?
Live version (from official store)
### Version
13.23.0
### Build type
None
### Browser
Chrome
### Operating system
MacOS
### Hardware wallet
_No response_
### Additional context
- Network: KONET Mainnet
- Chain ID: 17217
- RPC URL: https://https://api.kon-wallet.com
The issue occurs consistently when using the custom network.
I have already tried:
- Restarting MetaMask
- Re-adding the network
- Switching accounts
But the issue still persists.
This seems related to custom EVM network handling where account or network state becomes undefined.
### Severity
High - The wallet cannot be used when connected to the KONET network.
This issue blocks normal wallet functionality.
Contributor guide
Research direction
Start at the isEVMAccountForSend entry point named in the stack trace and reproduce with the KONET custom network, Chain ID 17217, using the listed RPC URL. Trace which account or network value is undefined during wallet loading and verify the wallet displays account information without the startsWith error after switching networks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- blockchain
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100