-
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
1.0.7 and later broken in the browser #8
Comments
I think I've fixed it later on. Is it still a problem on 1.1.0? |
Yes it's still broken in 1.1.0. https://github.com/indutny/brorand/blob/master/index.js#L31 You don't have |
Well, this code relies on I'd say that you are most likely using old version of it somehow, perhaps it is either a cache or stale build result. I'm using this updated module for: http://indutny.github.io/self-signed/ and it appears to work in the browser. |
It's not an old version...we've fallen back to 1.0.6 for the time being. How does |
Would you care to share some code with me so I could reproduce it? Thanks, and sorry for the problem! |
The code is the bcoin project...we wrap it into a Cordova app, and it's throwing because self.crypto is undefined... Here's a full stack trace when using brorand 1.1.0:
While the source lines won't be useful, I'm sure you can recognize the piece of bcoin and elliptic: |
bcoin is specifying elliptic 6.3.2, which is not the latest, if that's an issue: Again I still don't understand who/what/where |
@mcelrath could you please provide a couple of lines around |
bundle.js:44277 is https://github.com/indutny/brorand/blob/master/index.js#L35 Here's the entire thing, cut and pasted from the inspector. It's just brorand 1.1.0.
|
It looks like someone has set |
You're depending on some implicit behavior with respect to the
All that said, I found some of our code is spuriously setting |
I believe |
I've never seen that before...that is tricky. Ok I'm closing this as it looks like my bug. Sorry for the noise. |
No problem at all! Thanks for using it, and sorry for causing trouble by the recent update! |
Commit #7 breaks the use of brorand by bcoin in Cordova.
You never define self anywhere, and it throws
TypeError: Cannot read property 'getRandomValues' of undefined
. I don't know how this is supposed to work...The text was updated successfully, but these errors were encountered: