Skip to content

Commit 1cd4582

Browse files
committedFeb 23, 2024··
feat(hardware-trezor): conditionally load trezor dependency so that it works with bundlers
1 parent 7f6151d commit 1cd4582

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎packages/hardware-trezor/src/TrezorKeyAgent.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ import {
1616
util
1717
} from '@cardano-sdk/key-management';
1818
import { txToTrezor } from './transformers/tx';
19-
import TrezorConnectWeb from '@trezor/connect-web';
19+
import _TrezorConnectWeb from '@trezor/connect-web';
2020

2121
const TrezorConnectNode = Trezor.default;
22+
const TrezorConnectWeb = (_TrezorConnectWeb as any).default
23+
? ((_TrezorConnectWeb as any).default as typeof _TrezorConnectWeb)
24+
: _TrezorConnectWeb;
2225

2326
const transportTypedError = (error?: any) =>
2427
new errors.AuthenticationError(

0 commit comments

Comments
 (0)
Please sign in to comment.