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]: Local ESM import does not specify extension #7871

Open
Zosoled opened this issue Sep 20, 2024 · 1 comment
Open

[Bug]: Local ESM import does not specify extension #7871

Zosoled opened this issue Sep 20, 2024 · 1 comment
Labels
bug Something isn't working libraries Impacts the Libraries triage In need of triage

Comments

@Zosoled
Copy link

Zosoled commented Sep 20, 2024

Impacted Library name

@ledgerhq/hw-transport-web-ble

Impacted Library version

6.29.3

Describe the bug

lines 11 and 12 of TransportWebBLE.ts reference local imports. After building, the emitted .js file in /lib-es/ does not specify the full path including extension and so attempting to reference the ESM version fails.

Expected behavior

Importing from @ledgerhq/hw-transport-web-ble/lib-es/TransportWebBLE.js does not fail due to the aforementioned issue.

Additional context

The reason I tried importing the file directly is because importing normally with import { default as BluetoothTransport } from @ledgerhq/hw-transport-web-ble does not properly import, and that is because it is being exported with exports.default = BluetoothTransport instead of module.exports = BluetoothTransport in /lib/TransportWebBLE.js.

@Zosoled Zosoled added bug Something isn't working libraries Impacts the Libraries triage In need of triage labels Sep 20, 2024
@Zosoled
Copy link
Author

Zosoled commented Sep 20, 2024

It looks like this may also be an issue in @ledgerhq/hw-transport-webusb.

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