tronprotocol/tronweb

Tronweb is not a constructor

Sam15766 opened this issue · 1 comments

Hi guys, I need some help.

I am trying to make a script using tron network and when I am importing the network for utilization I keep getting the error tronweb is not a constructor.

I am using 6.0.0 and this is what it looks like

const tronWeb = new TronWeb({
fullHost: 'https://api.trongrid.io',
privateKey: '', // Replace with your actual private key

please help me, ive tried uninstalling and re installing tron and clearing caches and everuthing

TronWeb has released v6.0.0 version which uses named import:

const { TronWeb } = require('tronweb');
or
import { TronWeb } from 'tronweb';

For more details, check out here