-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: React Native
How frequently does the bug occur?
Always
Description
I integrated Realm in a React Native app using version 0.71.7 , created a schema and followed the basic setup and all works perfectly fine. When I added the uuid field and used the new Realm.BSON.UUID() to generate an id, It does actually generate an Id and I confirmed it by printing the value however I receive a warning as illustrated in the image below:
upon clicking it it expands to show:
Stacktrace & log output
Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
WARN BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.
Can you reproduce the bug?
Always
Reproduction Steps
- create a react native project
- setup real by following basic real setup docs for react native
- add a schema that has a uuid field for ex:
export class CarSchema extends Realm.Object<CarSchema> { name!: string; brand!: string; makeYear?: number; price!: number; _id!: Realm.BSON.UUID; static schema = { name: 'CarSchema', properties: { _id: 'uuid', name: 'string', brand: 'string', makeYear: 'int?', price: 'float', }, }; }
- in your app.tsx add the following before the return statement
const addObject = () => realm.write(() => realm.create(CarSchema, { _id: new Realm.BSON.UUID(), name: 'X6', brand: 'BMW', price: 300000, makeYear: 2023, }), );
and the following in your return statement:
{{<Button label="add car" onPress=
/>}}
after clicking the button you will get the same warning
Version
latest
What services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
android API 30
Build environment
Which debugger for React Native: ..
Cocoapods version
No response