MetaMask / MetaMask/metamask-extension
[Bug]: Install - `TypeError: Cannot read properties of undefined (reading 'getSelf')`
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
### Describe the bug
Whenever I import the Extension for the first time, if I open the offscreen.html I get the following error `TypeError: Cannot read properties of undefined (reading 'getSelf')`
### Expected behavior
No error
### Screenshots/Recordings
https://github.com/user-attachments/assets/ca4f361f-ceda-49d0-b455-8f49d1084903
### Steps to reproduce
1. Import a MM build
2. Open the offscreen.html
3. See error
### Error messages or log output
```shell
TypeError: Cannot read properties of undefined (reading 'getSelf')
```
### Where was this bug found?
Internal release testing
### Version
found in 13.28.0 but might be already in prod, but I haven't seen any Sentry entries
### Build type
None
### Browser
Chrome
### Operating system
MacOS
### Hardware wallet
_No response_
### Additional context
_No response_
### Severity
_No response_
[Jira issue](https://consensyssoftware.atlassian.net/browse/MCTP-270)
### Expected behavior
No response
### Screenshots/Recordings
No response
### Steps to reproduce
1. Import a MM build
2. Open the offscreen.html
3. See error
### Error messages or log output
```shell
TypeError: Cannot read properties of undefined (reading 'getSelf')
```
### Where was this bug found?
No response
### Version
found in 13.28.0 but might be already in prod, but I haven't seen any Sentry entries
### Build number
No response
### Build type
None
### Browser
Chrome
### Operating system
MacOS
### Hardware wallet
No response
### Additional context
No response
### Severity
Sev2
Contributor guide
Research direction
Reproduce the issue in Chrome by importing a MetaMask build and opening offscreen.html, then locate the code path that reads getSelf. Confirm the fix by opening offscreen.html again and verifying that the TypeError no longer appears.
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
- 52/100