Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

crypto.getRandomValues() not supported

I'm getting this error with npm [email protected] when I try to generate a QR code with react-native-qrcode-generator

I'm using react-native with an expo managed workflow. And the thing is it works on iOS, and i only get the error on Android

I searched for a solution myself and I tried installing react-native-get-random-values but that also didn't work.

Any thoughts?

like image 471
jsnid00 Avatar asked Feb 03 '23 15:02

jsnid00


1 Answers

React Native

Install react-native-get-random-values
Import it before uuid:
import 'react-native-get-random-values';
import { v4 as uuidv4 } from 'uuid';
like image 181
Edi Avatar answered Feb 19 '23 22:02

Edi