TypeError: TransactionError is not a constructor

Hello,

I have been getting TypeError: TransactionError is not a constructor instead of error object I defined.

Problem occurred when TransactionError was imported from lisk-sdk

const {
    transactions: { BaseTransaction },
    TransactionError,
} = require('lisk-sdk');

It works fine when it’s imported from lisk-transactions

const {TransactionError} = require("@liskhq/lisk-transactions");

Thanks to @Moosty

Cheers
k.

1 Like

TransactionError is exported under transactions.
It should work if you import like

const {
  transactions: { BaseTransaction, TransactionError },
} = require('lisk-sdk');
1 Like