Skip to content
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

[Sentry] TypeError: Cannot convert undefined or null to object [553K events] #28019

Closed
sentry-io bot opened this issue Oct 22, 2024 · 6 comments · Fixed by #28870
Closed

[Sentry] TypeError: Cannot convert undefined or null to object [553K events] #28019

sentry-io bot opened this issue Oct 22, 2024 · 6 comments · Fixed by #28870
Labels
area-Sentry error reporting to sentry Sev2-normal Normal severity; minor loss of service or inconvenience. type-bug

Comments

@sentry-io
Copy link

sentry-io bot commented Oct 22, 2024

Sentry Issue: METAMASK-XCEB

TypeError: Cannot convert undefined or null to object
  at Function.values (<anonymous>)
  at exports.getProviderConfig (ui/ducks/metamask/metamask.js:286:34)
  at obj[prop] (/metamask/scripts/sentry-install.js:24:1)
  at obj[prop] (/metamask/scripts/sentry-install.js:24:1)
  at obj[prop] (/metamask/scripts/sentry-install.js:24:1)
...
(28 additional frame(s) were not displayed)
@gauthierpetetin gauthierpetetin added type-bug Sev2-normal Normal severity; minor loss of service or inconvenience. team-assets labels Oct 22, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by team Oct 22, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by severity Oct 22, 2024
@gauthierpetetin gauthierpetetin added area-Sentry error reporting to sentry regression-prod-12.5.0 Regression bug that was found in production in release 12.5.0 labels Oct 22, 2024
@metamaskbot metamaskbot changed the title TypeError: Cannot convert undefined or null to object [Sentry] TypeError: Cannot convert undefined or null to object Oct 23, 2024
Copy link
Author

sentry-io bot commented Oct 23, 2024

Sentry Issue: METAMASK-XCEB

@seaona
Copy link
Contributor

seaona commented Dec 3, 2024

I encountered this issue in 12.9.0. The impact seems pretty high, as whenever this happens I am not able to import tokens anymore as the MM crashes everytime, no matter if I reload the extension.

Repro

  1. Settings:
  • Show native token as main balance ON
  • Show balance and token price OFF
  • Token autodetect ON
  1. Select an account which has some ERC20 tokens in Polygon
  2. Add Polygon default network
  3. See tokens are autodetected and you can open the modal -> but don't import the tokens!
  4. Go to Chainlist
  5. Add another Polygon RPC
  6. Go to the wallet and see token autodetection still works
  7. Switch to another network
  8. Delete Polygon network
  9. Re-add Polygon default network
  10. Click Import tokens --> see wallet crashes everytime, even after reloading the app
  11. [WORKAROUND] Now enable the Show balance and token price --> see how wallet doesn't crash anymore

Screenshot from 2024-12-03 09-24-13

full-repro-convert-undefined-null-token.mp4

@seaona seaona changed the title [Sentry] TypeError: Cannot convert undefined or null to object [Sentry] TypeError: Cannot convert undefined or null to object [553K events] Dec 3, 2024
@seaona
Copy link
Contributor

seaona commented Dec 3, 2024

ℹ️ Possibly a fix should be prioritized given the amount of occurrences this issue has and the impact of the issue (breaking the auto-detect functionality)

@danjm
Copy link
Contributor

danjm commented Dec 4, 2024

@seaona I think the error you hit is different than the one on sentry. The sentry issue has " at Function.values ()
at exports.getProviderConfig (ui/ducks/metamask/metamask.js:286:34)" in its stack trace, while your screen shot shows Function.entries and useTokenFiatAmount in the stack trace

@seaona
Copy link
Contributor

seaona commented Dec 4, 2024

whoa that's a great catch!! Indeed those are different. Then this ticket should remain opened. I'll open a separate ticket for the assets one (yesterday we got 2 more tickets related to the assets one, so maybe we could either point those or create a new one - they have different repro steps each)

Thank you @danjm

github-merge-queue bot pushed a commit that referenced this issue Dec 5, 2024
## **Description**

This PR fixes app crash after user removes a network then adds it back
and clicks on import token banner

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28870?quickstart=1)

## **Related issues**

Fixes:
#28019 (comment)
Fixes: #28882
Fixes: #28864

## **Manual testing steps**
Manual steps are also described in the github
[issue](#28019 (comment)).
However; I do not think that the Show native token as main balance needs
to be ONt o repro the initial issue. Also no need to add new RPC from
chainList;

Settings:
1. Show balance and token price OFF
2. Token autodetect ON

On main view

1. Select an account which has some ERC20 tokens in Polygon
2. Add Polygon default network
3. See tokens are autodetected and you can open the modal -> but don't
import the tokens!
4. Switch to another network
5. Delete Polygon network
6. Re-add Polygon default network
7. Click Import tokens --> Wallet should not crash

12. ## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: Nick Gambino <[email protected]>
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by severity Dec 5, 2024
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by team Dec 5, 2024
@metamaskbot metamaskbot added the release-12.10.0 Issue or pull request that will be included in release 12.10.0 label Dec 5, 2024
gambinish added a commit that referenced this issue Dec 5, 2024
## **Description**

This PR fixes app crash after user removes a network then adds it back
and clicks on import token banner

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28870?quickstart=1)

## **Related issues**

Fixes:
#28019 (comment)
Fixes: #28882
Fixes: #28864

## **Manual testing steps**
Manual steps are also described in the github
[issue](#28019 (comment)).
However; I do not think that the Show native token as main balance needs
to be ONt o repro the initial issue. Also no need to add new RPC from
chainList;

Settings:
1. Show balance and token price OFF
2. Token autodetect ON

On main view

1. Select an account which has some ERC20 tokens in Polygon
2. Add Polygon default network
3. See tokens are autodetected and you can open the modal -> but don't
import the tokens!
4. Switch to another network
5. Delete Polygon network
6. Re-add Polygon default network
7. Click Import tokens --> Wallet should not crash

12. ## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: Nick Gambino <[email protected]>
@seaona
Copy link
Contributor

seaona commented Dec 10, 2024

The issue above has different stack traces than the issue for Assets, so this ticket should remain opened, as @danjm pointed out above

@seaona seaona reopened this Dec 10, 2024
@github-project-automation github-project-automation bot moved this from Fixed to To be fixed in Bugs by team Dec 10, 2024
@seaona seaona removed regression-prod-12.5.0 Regression bug that was found in production in release 12.5.0 release-12.10.0 Issue or pull request that will be included in release 12.10.0 labels Dec 10, 2024
@danjm danjm closed this as completed in e8a5d50 Dec 13, 2024
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by team Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Sentry error reporting to sentry Sev2-normal Normal severity; minor loss of service or inconvenience. type-bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants