Getting Tx is not a constructor when executing web3 sendSignedtransaction 1


Are you facing this issue while sending a signedTransaction in Web3.js?

If this is your code to fetch ethereumjs-tx library:

var Tx     = require('ethereumjs-tx')
const Web3 = require('web3')

 

Then you need to change it like:

 

 

var Tx     = require('ethereumjs-tx').Transaction
const Web3 = require('web3')

I hope it worked!