MetaMask / MetaMask/metamask-extension
[Bug]: new BigNumber() not a number error when adding comma symbol in Perps witdraw/add and mUSD convert
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
**Describe the bug**
When adding a `comma` symbol in Perps withdraw/add and mUSD convert flows amount field, the following error is displayed:
`BigNumber Error: new BigNumber() not a number: 1`
Closing and re-opening MetaMask fixes the issue
**Expected behavior**
No error
**Screenshots/Recordings**
https://github.com/user-attachments/assets/6ab076cc-8f3b-4dcd-89cd-b02641c313a3
**Steps to reproduce**
1. Go to Perps Add or Withdraw or mUSD convert flow
2. Type comma in the amount fiels
3. Notice error
**Error messages or log output**
```shell
React Router caught the following error during render BigNumber Error: new BigNumber() not a number: 0, Object
```
**Where was this bug found?**
Internal release testing
**Version**
13.40.0
**Browser**
Chrome
**Operating system**
MacOS
Contributor guide
Research direction
Start by reproducing the issue in the Perps Add, Perps Withdraw, and mUSD convert flows using a comma in the amount field, then trace the amount handling that leads to the BigNumber render error. Done means comma input no longer produces the error and the flows continue without requiring MetaMask to be closed and reopened.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100