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]: ethers.js Should Be Listed as a Dependency, Not a DevDependency (@ledgerhq/hw-app-eth) #8181

Open
superKalo opened this issue Oct 23, 2024 · 1 comment
Labels
bug Something isn't working libraries Impacts the Libraries Stale triage In need of triage

Comments

@superKalo
Copy link

superKalo commented Oct 23, 2024

Impacted Library name

@ledgerhq/hw-app-eth

Impacted Library version

6.40.2

Describe the bug

I'm using @ledgerhq/hw-app-eth in my project, and I’ve noticed that in the latest version (6.40.2) of your @ledgerhq/hw-app-eth package ethers.js is listed as a devDependency in the package's package.json. However, ethers.js is also required for runtime usage in the package’s code (e.g., in lib-es/services/ledger/index.js), which makes it a necessary runtime dependency, not just for development.

The Problem: Since ethers.js is listed as a devDependency, it’s not installed when users of @ledgerhq/hw-app-eth add the package to their projects. This results in the package trying to use whatever version of ethers is present in the consuming project. In my case, I’m using ethers v6, but @ledgerhq/hw-app-eth expects ethers v5, which leads to compatibility issues and warnings like this:

WARNING in ./node_modules/@ledgerhq/hw-app-eth/lib-es/modules/Uniswap/decoders.js:15:23
export 'utils' (imported as 'utils') was not found in 'ethers'

WARNING in ./node_modules/@ledgerhq/hw-app-eth/lib-es/modules/Uniswap/index.js:84:35
export 'utils' (imported as 'utils') was not found in 'ethers'

WARNING in ./node_modules/@ledgerhq/hw-app-eth/lib-es/services/ledger/index.js:136:29
export 'utils' (imported as 'utils') was not found in 'ethers'

Expected behavior

To resolve this, ethers.js should be moved from devDependencies to dependencies in package.json, so that it is correctly installed alongside @ledgerhq/hw-app-eth and the proper version (v5.x.x) is available for runtime use.

This change will ensure that @ledgerhq/hw-app-eth works as expected in projects that may already be using a different version of ethers.js, preventing the above errors and improving compatibility for all users.

Additional context

This is reproducible with @ledgerhq/hw-app-eth v6.40.x. I downgraded to v6.39.0 where the problem is not present yet.

@superKalo superKalo added bug Something isn't working libraries Impacts the Libraries triage In need of triage labels Oct 23, 2024
@superKalo superKalo changed the title [Bug]: ethers.js Should Be Listed as a Dependency, Not a DevDependency [Bug]: ethers.js Should Be Listed as a Dependency, Not a DevDependency (@ledgerhq/hw-app-eth) Oct 23, 2024
Copy link

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

@github-actions github-actions bot added the Stale label Nov 24, 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 Stale triage In need of triage
Projects
None yet
Development

No branches or pull requests

1 participant