cypto.getRandomValues() not supported

Hey, I am new to both React Native and Snack. I was using the Traversy Media tutorial to help me get a feel for it and making the starting program. However, about halfway through, I have run into a problem. When I try to generate a UUID for a new string, the debugger says “Device: (3:1602) UUID: This browser does not seem to support crypto.getRandomValues(). If you need to support this browser, please provide a custom random number generator through options.rng.” I am currently using Firefox, and the android emulator is having this problem. This problem also occurs when I run it on my Android Phone. How can I fix this?

Traversy Media Video: https://www.youtube.com/watch?v=Hf4MJH0jDb4 (29:03)

Hi

You might want to upvote the following feature request:

https://expo.canny.io/feature-requests/p/expose-web-crypto-api

I’m not sure why it’s working in the video, but instead of waiting for crypto.getRandomValues() to be implemented, you could use a different UUID module:

import uuid from 'uuid-random';

console.log(uuid());
2 Likes

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.