LedgerHQ/ledgerjs

Buffer is not defined in `@ledgerhq/hw-transport-webusb`

goga-m opened this issue · 1 comments

Hey there,

Using @ledgerhq/hw-transport-webusb in browser with vite and I get the Buffer is not defined error.

If I am not mistaken it seems that it's only used in https://github.com/LedgerHQ/ledgerjs/blob/master/packages/hw-transport-webusb/src/TransportWebUSB.ts#L208.

As this package is meant to be used in browser, was wondering if you see any issues using https://github.com/feross/buffer instead of trying to access Buffer globally so that consumers wouldn't be required to add polyfills.

Thanks in advance.

Yeah, basically same issue on my end