Skip to content

Commit

Permalink
fix(wallet-ledger): incorrect CommonJS import (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
tien authored Oct 1, 2024
1 parent adabaa2 commit 24913cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tall-schools-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@reactive-dot/wallet-ledger": patch
---

Fixed incorrect CommonJS import for Buffer polyfill.
4 changes: 3 additions & 1 deletion packages/wallet-ledger/src/ledger-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ export class LedgerWallet extends LocalWallet<LedgerAccount, "accounts"> {
}

if (!("Buffer" in globalThis)) {
const { Buffer } = await import("buffer/");
const {
default: { Buffer },
} = await import("buffer/");

// @ts-expect-error polyfill types mismatch
globalThis.Buffer = Buffer;
Expand Down

0 comments on commit 24913cb

Please sign in to comment.