简体   繁体   中英

ReferenceError: Can't find variable: uuid

ReferenceError: Can't find variable: uuid

Getting this error in my react native project while using the uuidv4 package. I am importing into my file in this way:

import 'react-native-get-random-values';

import {uuid} from 'uuidv4';

After dismissing the error, the app works fine and uuids are being generated. Error appears only right after building the app

You may try uuid( https://www.npmjs.com/package/uuid ) package and can use it like this:

import { v4 as uuidv4 } from 'uuid'; uuidv4();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM