stacks.js icon indicating copy to clipboard operation
stacks.js copied to clipboard

React Native: Environment does not have randomBytes function

Open gendev1 opened this issue 1 year ago • 1 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()

gendev1 avatar Apr 15 '24 00:04 gendev1

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

janniks avatar Apr 15 '24 15:04 janniks

Hi -- I added a Guide to our docs 🙏

janniks avatar Jun 17 '24 12:06 janniks