Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Buffer is not defined in @ledgerhq/hw-transport-webusb #8677

Open
mcmxcdev opened this issue Dec 12, 2024 · 0 comments
Open

[Bug]: Buffer is not defined in @ledgerhq/hw-transport-webusb #8677

mcmxcdev opened this issue Dec 12, 2024 · 0 comments
Labels
bug Something isn't working libraries Impacts the Libraries triage In need of triage

Comments

@mcmxcdev
Copy link

mcmxcdev commented Dec 12, 2024

Impacted Library name

@ledgerhq/hw-transport-webusb

Impacted Library version

6.29.4

Describe the bug

LedgerHQ/ledgerjs#734 is still relevant and unfixed after more than 3 years and breaks the application as soon as importing e.g. import Transport from '@ledgerhq/hw-transport-webusb'.

This makes a really bad impression for a first-time user of the library which I am expecting more from.

The error stack trace points to a usage of Buffer.alloc(0) which is a Node.js specific global which doesn't work in the browser.

It can easily be replaced with new Uint8Array(0) which is supported in all environments, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array

Expected behavior

Expect no error like ReferenceError: Buffer is not defined to show up.

Additional context

No response

@mcmxcdev mcmxcdev added bug Something isn't working libraries Impacts the Libraries triage In need of triage labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working libraries Impacts the Libraries triage In need of triage
Projects
None yet
Development

No branches or pull requests

1 participant