-
-
Notifications
You must be signed in to change notification settings - Fork 210
Open
Description
I have been having issues with browserified code using this package because it depends on non-browserified code to implement itself.
Basically, this line is the issue:
exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require('randombytes');
When you require crypto-browserify
, you're not using the non-browserified crypto
package. But if you go to randombytes
' implementation, it requires crypto
in its code. This causes two issues:
- If you are resolving requires to
crypto
ascrypto-browserify
, you get a circular dependency and therandomBytes
field becomesundefined
. - If you are not,
randombytes
will just require regularcrypto
, which defeats the whole purpose of using a browserified package in the first place. You probably won't have it available in your environment and just end up with nothing in therandomBytes
field anyway.
Maybe this is an issue for randombytes instead. But I figured that most packages that depend on randomBytes
usually require crypto
instead of randombytes
.
Metadata
Metadata
Assignees
Labels
No labels