hirosystems/stacks.js

React Native: Environment does not have randomBytes function

gendev1 opened this issue · 2 comments

What version of Stacks.js are you using?

@stacks/wallet-sdk v 6.13.1

Describe the bug

Been getting Environment does not have randomBytes function.
Tried on expo as well as react native projects
Did all pollyfills required for Buffer, TextEncoder, Crypto etc
Tried modifying the metro config file
Tried rn-nodeify and imported the shim file generated
Nothing seems to solve the issue

How to reproduce

  1. Create a new react native project
  2. Install @stacks/wallet-sdk
  3. Call generateSecretKey()

Thanks for the report. I will create a React-Native example / guide tomorrow to find out what's missing 🙏

Hi -- I added a Guide to our docs 🙏