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

Ledger Support Errors #411

Closed
gagdiez opened this issue Aug 17, 2022 · 6 comments
Closed

Ledger Support Errors #411

gagdiez opened this issue Aug 17, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@gagdiez
Copy link

gagdiez commented Aug 17, 2022

I have found the following error when using `import

{ setupLedger }

from "@near-wallet-selector/ledger";`. Particularly, the error is:

@parcel/core: Failed to resolve '@ledgerhq/devices/hid-framing' from './node_modules/@ledgerhq/hw-transport-webhid/lib-es/TransportWebHID.js'

To reproduce simply add the ledger package and try to use it.

@gagdiez gagdiez added the bug Something isn't working label Aug 17, 2022
@gagdiez
Copy link
Author

gagdiez commented Aug 17, 2022

A discord user has reported another error: https://discord.com/channels/490367152054992913/542945453533036544/1009482022290464819

@kujtimprenkuSQA
Copy link
Contributor

Hey, @gagdiez thank you for raising this issue.

After some investigation yesterday in the issue we found that this error is showing up only with parcel and not in other bundlers.

This issue seems to be on the latest version of @ledgerhq/hw-transport-webhid which internaly depends on @ledgerhq/devices and also is a dependency in our @near-wallet-selector/ledger package.

We found this suggestion here to be a good solution: LedgerHQ/ledger-live#763 (comment).

Basically this si what is being suggested there: adding parcel-style alias to the package.json seems to help:

{ 
  ...
  "alias": {
    "@ledgerhq/devices": "@ledgerhq/devices/lib-es"
  }
}

See their docs on using these packages with parcel: https://developers.ledger.com/docs/transport/web-hid-usb/#packagejson


About the reported issue on discord, there was not enough information to know what the exact issue was so I asked them to open a new issue here in this repo.

@gagdiez
Copy link
Author

gagdiez commented Aug 22, 2022

Thanks, adding the alias resulted in a different error, which I solved by adding a second alias:

"process": { "global": "{}" }

Maybe it would be useful to add that in the README (#414 )

@kujtimprenkuSQA
Copy link
Contributor

Was the error about process caused by @near-walllet-selector/ledger ?

The error about process might be related to something else, can you please share more details or a screenshot?

@gagdiez
Copy link
Author

gagdiez commented Aug 23, 2022

I further tested it, and the error was not being originated from the wallet-selector/ledger.

I saw your comment in the PR, with the Known Issue being added to the Ledger page. I would still recommend to bring it to the front README.md so people can find it easier.

@kujtimprenkuSQA
Copy link
Contributor

Hey, @gagdiez after more investigation on the issue which was happening with dApps that use parcel as a bundler I found that removing the caret (^) symbol from @ledgerhq/hw-transport-webhid and @ledgerhq/hw-transport on our side avoids these errors which are caused by the latest versions of these dependencies.

I also addressed the issue reported on discord.
I believe we will need to publish a minor release.

Thank you for your feedback again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants