Skip to content

crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supporte #514

@coawazie

Description

@coawazie

Just got this surprising error after using uuid for so long

Environment
"react-native": "0.63.2"
"react-native-get-random-values": "^1.4.0"
"uuid": "^8.3.0"

What was tried
I get this error when const id = uuidv4() runs. I added "react-native-get-random-values" as suggested, but with yarn and imported it this way;

import React, {useState} from 'react';
import 'react-native-get-random-values';
import {v4 as uuidv4} from 'uuid';
import RNPickerSelect from 'react-native-picker-select';

I am still getting the same error. Have to figure out other ways to generate a random ID then.

[Clear, concise description of the problem]

How to reproduce

  1. Install the uuid and react-native-get-random-values
  2. try running a component with this const id = uuidv4()

Expected behavior

Should generate random ids

Runtime

  • OS: macOS
  • Runtime: react-native
  • Runtime Version: 0.63.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions