tronprotocol / tronweb

Javascript API Library for interacting with the TRON Network
MIT License
431 stars 272 forks source link

Uncaught TypeError: Cannot destructure property 'Transaction' of 'globalThis.TronWebProto' as it is undefined. #496

Closed jeancarrie-kima closed 6 months ago

jeancarrie-kima commented 6 months ago

I am having this error after updating tronweb version as 6.0.0-beta.1. The app works on the browser which has tronlink wallet installed, but doesn't work on the other browsers without tronlink.

jeancarrie-kima commented 6 months ago

image

start940315 commented 6 months ago

Can you provide a demo that demonstrate your problem?

jeancarrie-kima commented 6 months ago

https://github.com/kima-finance/kima-transaction-widget Please check this open source project, you can run the example folder using yarn start.

start940315 commented 6 months ago

I see. You use react-scripts, and it didn't load cjs files properly. You need to add the cjs rule manually:

{
      test: /\.cjs$/,
      type: 'javascript/auto'
},
jeancarrie-kima commented 6 months ago

@start940315 Thank you for your support, the issue resolved 👍