Skip to content

Browser extension v2.91.4+ can't sign TRON USDT dApp transactions — "Cannot read properties of undefined (reading 'Tron')" #4844

Description

@josesanchesx83-cloud

Describe the bug
The browser extension fails to sign TRON smart-contract transactions requested by a dApp
(e.g. a standard TRC-20 approve on USDT TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t). Connecting
works and the tx is shown with a fee, but pressing Confirm throws and the dApp never receives
a signature. The same transaction signs fine in TronLink and in Trust Wallet mobile, so the
transaction is valid — only recent desktop-extension builds are affected.

Error (extension DevTools console):
TypeError: Cannot read properties of undefined (reading 'Tron')
at TronService.signTransaction (background.js)

To Reproduce

  1. Connect the browser extension to a TRON dApp.
  2. Request a USDT (TRC-20) approve.
  3. Click Confirm.
  4. Error appears; the dApp never receives a signature.

Expected behavior
The transaction is signed and returned to the dApp (as it already is in TronLink and Trust Wallet mobile).

Additional context
Root cause, traced on the shipped background.js:

  • The crash is in the Tronify path: rentEnergyForTransactiongetSwapDomain → reads
    AmberDomainType.Tron, but the Amber module (import_trust_sdk$15) is undefined.
  • Version bisect:
Version Bundler Result
2.91.2 webpack (__webpack_require__, eager) works
2.91.4 / 2.91.5 / 26.x esbuild (import_trust_sdk$15, lazy) crash
  • Regression introduced in v2.91.3/2.91.4 with the webpack→esbuild switch: under esbuild the
    Amber module isn't initialized before getSwapDomain uses it in the service worker → undefined
    → crash. Only the dApp/WalletConnect signing path is affected (in-app USDT send works).

Suggested fix: eagerly initialize the Amber module before the Tronify path calls getSwapDomain
(or guard / fall back to the regular fee on error). Interim: roll back the
extension-tronify-enabled experiment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions