-
Notifications
You must be signed in to change notification settings - Fork 17
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
TypeError: data.readUIntBE is not a function #37
Comments
the code you are referencing was present also in version 5 of this lib:
To pinpoint the actual issue I'd suggest trying to debug the |
Hi @refi93, thanks for the answer, thought I had replied to you already, srry. Still will be facing this in the future i guess, need to spend more time to deal with it. |
I'm closing this for now since I don't see what we can do to improve the situation (we also have limited resources). |
Hello, it seems like we have the same problem when trying to update version from 5 to 6 on Ledger Live mobile Weirdly no error on Ledger Live desktop, we use a require to add buffer lib so it might be related to it, I am investigating |
Does it also occur if you use version 7? |
Hey @janmazak, Thanks to the investigation of Strica, we found out that the culprit is subarray method. Buffer.subarray returns UInt8Array instead of Buffer, so data.readUIntBE is undefined. This only happens in our Ledger Live Mobile usage and not on Ledger Live Desktop. This is not expected behavior, see : Subarray usage has been introduced in v6 and is not present in v5, that's why we had no problem until now. I don't know what's really causing the difference between those environments but maybe it's related to int64-buffer, "It uses Buffer on Node.js and Uint8Array on modern Web browsers" as stated in the readme Since v7 uses subarray aswell, I am confident we will have the issue. Maybe we could go back and use slice instead of subarray ? Have a nice day |
@hedi-edelbloute |
Hey @janmazak that's it, other instances should be replaced too, thanks ! |
The issue should be fixed in 7.0.1: |
@hedi-edelbloute |
Hi @janmazak , it fixed our issues on mobile (iOS & Android), thank you very much ! Have a nice weekend :) |
FYI @zxpectre |
Hi, we are currently hitting
TypeError: data.readUIntBE is not a function
error when calling basic methods likeledgerAppAda.getSerial()
andledgerAppAda.getVersion()
, testing on a Nano S.Aparently on this too lines:
ledgerjs-hw-app-cardano/src/utils/serialize.ts
Line 43 in 5e83052
and
ledgerjs-hw-app-cardano/src/utils/serialize.ts
Line 57 in 5e83052
We are using version
@cardano-foundation/[email protected]
and because of too many dependencies to keep we are stuck in an old react-scripts 4 and node, npm versions old as well.
Is there any workaround to this posible rather than updating everything on our side please?
Big project, small community team here!
Downgrading to
@cardano-foundation/[email protected]
is incompatible with latest Ledger Cardano AppThe text was updated successfully, but these errors were encountered: