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]: @ledgerhq/hw-transport-node-hid-singleton wrapped with an extra default #9462

Open
davidyuk opened this issue Mar 8, 2025 · 0 comments
Labels
bug Something isn't working libraries Impacts the Libraries triage In need of triage

Comments

@davidyuk
Copy link
Contributor

davidyuk commented Mar 8, 2025

Impacted Library name

@ledgerhq/hw-transport-node-hid-singleton

Impacted Library version

6.31.5

Describe the bug

The package exports are wrapped with an object with the default property. Reproduction:

  • create test.mjs with a content
import TransportNodeHid from '@ledgerhq/hw-transport-node-hid-singleton';

console.log('TransportNodeHid', TransportNodeHid);
  • run node test.mjs
  • see output
TransportNodeHid {
  default: [class TransportNodeHidSingleton extends TransportNodeHidNoEvents] {
    isSupported: [Function (anonymous)],
    list: [Function (anonymous)],
    listen: [Function (anonymous)]
  }
}

This is getting worse in TypeScript. When I'm accessing TransportNodeHid.default I'm getting

Property 'default' does not exist on type 'typeof TransportNodeHidSingleton'. ts(2339)

Expected behavior

When I import the package by default, it shouldn't require me to add .default to get its payload.

Additional context

No response

@davidyuk davidyuk added bug Something isn't working libraries Impacts the Libraries triage In need of triage labels Mar 8, 2025
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