Chrome extensions continue to be a major source of JavaScript errors on production websites. The Trust Wallet browser extension is now contributing its own noise to error logs with unhandled promise rejections when it tries to access properties on null objects.

The Error

The error will be recorded as:

Unhandled Promise Rejection: Cannot read properties of null (reading 'type')

With stack traces pointing to:


chrome-extension://egjidjbpglichdcondbcbdnbeeppgdph/...

What’s Actually Happening

Trust Wallet is a popular cryptocurrency wallet browser extension that injects JavaScript into every page you visit. The extension attempts to detect Web3 elements, blockchain interactions, and DeFi protocols on websites. During this detection process, it encounters null objects and fails to properly check them before accessing the type property.

The error occurs when Trust Wallet’s injected code does something like:


// Simplified representation of the error
async function detectWeb3Element(element) {
  // element is null but code doesn't check
  if (element.type === 'web3-provider') { // TypeError!
    // Process Web3 connection
  }
}

Key characteristics:

  • Originates from Trust Wallet’s extension ID: egjidjbpglichdcondbcbdnbeeppgdph
  • Appears as an unhandled promise rejection
  • Occurs on any website, not just crypto-related sites
  • The extension runs on every page load, scanning for Web3 elements

Understanding the Root Cause

Browser Extension Injection Behavior

Browser extensions with broad permissions inject scripts into every webpage. Trust Wallet needs these permissions to:

  • Detect decentralized app (DApp) connections
  • Inject Web3 providers
  • Monitor for cryptocurrency transaction requests
  • Provide wallet connectivity across all websites

This aggressive scanning means the extension runs its detection code even on sites with no blockchain functionality, increasing the likelihood of encountering unexpected null values.

Why Promise Rejections From Extensions Matter

When browser extensions throw unhandled promise rejections, they pollute your application’s error logs with issues you can’t fix. Unlike errors in your own code, you have no control over:

  • The extension’s code quality
  • When it executes
  • How it handles edge cases
  • Whether it properly checks for null values

The “type” Property Access Pattern

The specific “reading ‘type’” error suggests Trust Wallet is trying to identify elements or objects by their type property—likely looking for:

  • Web3 provider objects
  • Ethereum wallet interfaces
  • Blockchain connection indicators
  • Custom elements related to DeFi protocols

When these elements don’t exist (which is most websites), the extension encounters null references.

How to Fix Trust Wallet Extension Errors

Since this error comes from a third-party browser extension, the only solution is filtering it from your error monitoring:

Configure TrackJS to Ignore Trust Wallet Errors

Set up ignore rules to filter out Trust Wallet extension errors:

TrackJS Configuration:

  • URL contains: chrome-extension://egjidjbpglichdcondbcbdnbeeppgdph
  • Error message: Cannot read properties of null (reading 'type')
  • Error type: unhandledrejection

This filters out all errors from the Trust Wallet extension, preventing them from cluttering your error logs.

Alternative Filtering Patterns

For comprehensive browser extension filtering, you might also consider:

However, be cautious with broad filters as they might hide legitimate issues with your own browser extensions or development tools.

Identifying Other Extension Errors

Trust Wallet isn’t the only extension causing these issues. Look for these patterns to identify other problematic extensions:


// Common extension error patterns
chrome-extension://[extension-id]/injected.js
moz-extension://[uuid]/content-script.js
@webkit-masked-url://hidden/:264:9770

Each browser uses different URL schemes for extensions:

  • Chrome/Edge: chrome-extension://[32-character-id]/
  • Firefox: moz-extension://[uuid]/
  • Safari: @webkit-masked-url://hidden/ (Safari masks the actual extension URL for privacy)

Monitor Real Application Errors

Browser extension errors can create significant noise in your error monitoring, making it difficult to spot real issues. Error monitoring services like TrackJS can automatically filter out these extension errors while capturing genuine application problems that need your attention.

Without proper filtering, extension errors from Trust Wallet and similar tools can overwhelm your error logs, potentially hiding critical bugs that affect your users’ experience.

When Extension Errors Actually Matter

While Trust Wallet errors should generally be filtered, investigate if:

Your site has Web3 functionality:

  • You’re building a DApp or DeFi platform
  • Your site integrates with blockchain services
  • Users report wallet connection issues

Unusual patterns emerge:

  • Errors spike during specific user actions
  • Errors correlate with broken functionality
  • Multiple wallet extensions show similar errors

Security concerns:

  • If the errors reveal sensitive data in stack traces
  • If the extension appears to be malfunctioning in concerning ways

The Bigger Picture: Extension Pollution

Browser extensions are a growing source of JavaScript error noise. Popular extensions that commonly pollute error logs include:

  • Password managers (LastPass, 1Password, Bitwarden)
  • Ad blockers (AdBlock, uBlock Origin)
  • Shopping assistants (Honey, Rakuten)
  • Cryptocurrency wallets (MetaMask, Trust Wallet, Phantom)
  • Grammar checkers (Grammarly)
  • VPN extensions

Each can inject JavaScript that throws errors completely unrelated to your application, making a strong case for systematic extension error filtering in production monitoring.

Summary

The “Cannot read properties of null (reading ‘type’)” error from Trust Wallet (extension ID: egjidjbpglichdcondbcbdnbeeppgdph) is another example of browser extensions polluting error logs with issues outside your control. The extension’s Web3 detection code fails to properly check for null values before accessing properties.

The solution is straightforward: configure your error monitoring to filter out errors from this extension ID. This keeps your error logs focused on actual application issues you can fix, rather than third-party extension bugs that waste debugging time.

TrackJS is the easy way to monitor your JavaScript applications and fix production errors. TrackJS is provides detailed error monitoring and alerting to developers around the world at companies like 3M, Tidal, IKEA, Venmo, Allbirds, and Frontend Masters. TrackJS catches millions of errors from users everyday. Let's start catching yours.

Protect your JavaScript