composablesys / collabs

Collabs library monorepo
https://collabs.readthedocs.io/
Apache License 2.0
256 stars 11 forks source link

randomReplicaID: Avoid require("crypto") #236

Closed mweidner037 closed 1 year ago

mweidner037 commented 1 year ago

In randomReplicaID, we use Node's crypto library to get random bytes on NodeJS. Importing this library confuses Webpack even though it is only used on Node. Our current workaround uses eval("require"))("crypto"), but that causes warnings from Rollup. It would be nice to avoid these warnings.

mweidner037 commented 1 year ago

https://github.com/webpack/webpack/issues/8826