LedgerHQ / ledger-live

Mono-repository for packages related to Ledger Live and its JavaScript ecosystem.
MIT License
435 stars 332 forks source link

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

Open Zosoled opened 1 month ago

Zosoled commented 1 month ago

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 commented 1 month ago

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

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open 30 days with no activity. Remove stale label, comment, or consider closing it.

Zosoled commented 2 weeks ago

Still an issue in 6.29.4.