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: undefined is not a function (evaluating 'entropy.slice(...)') #87
Comments
I wonder if the dist files are missing the call to |
It seems to only be occurring on "older" (2+ years) mobile devices, still trying to narrow down further. The error occurs in a few more files, than mentioned above, when working with |
Can you confirm you are using a recent version of the dist files? The line Line 163 in a9bc2b5
|
Yes, it is the latest version. This is definitely not affecting all devices, and only the older ones at the moment, so there's probably a common element that we haven't found yet. Hopefully as we continue testing devices, we'll see a pattern. Also, we've seen this on both Android and iOS devices. |
Can you please provide a very short script that causes this? I need to be able to replicate it before I can add the test cases to protect from it in the future and make sure the fix works. I have PhantomJS, and without a TypedArray shim, it should fail the same way. I just haven't been able to reproduce it, even on old devices. |
Is this still an issue with ethers@3.0.1? I believe this should have been fixed a while ago, but the latest version tests using phantomjs against the dist files. The phantomjs environment is a fairly archaic environment itself, so likely if it works in phantomjs, it will work in any older environment. If this is still an issue though, please feel free to re-open. :) |
ethers.js/wallet/hdnode.js
Line 183 in a9bc2b5
Error occurs when attempting to use
slice
onentropy
. This only occurs whenentropy
is an array-like object and NOT an pure array. Occurs on some (not all) physical devices.Haven't had any issues on either the Android or iOS emulators.
Dropped in this snippet, which fixes the problem, but then it just keeps popping up in other places where
slice
is used.As a temporary fix, will try creating aslice
function and prototype it to all objects.Working now. Ended up just using the above snippet in the following files (directly before the
slice
call):The text was updated successfully, but these errors were encountered: