Realm in React native - TypeError: Undefined is not a function (evaluating _iterator3[typeof Symbol === "function"...
See original GitHub issueI am Currently developing an app in react-native in which I would like to create a Database on the device as well. I found a good library Realm to use as a Database storage in my app but I am having error in running it.
*App works fine when I activate Debug JS remotely
*Fails and gives error (TypeError: Undefined is not a function (evaluating _iterator3[typeof Symbol === “function”…) when I run it without using Debug JS remotely
I need help in determining the cause of my error What Am i missing here?
My code to handle Realm
Expected Results
Successfully running and Database usage
Actual Results
While fetching the Database without enabling the Debug JS remotely mode in React native
Code Sample
let userSchema = { name : ‘User’, primaryKey : ‘id’, properties : { id : {type:‘string’,indexed:true}, name : ‘string’, email : ‘string’, password : ‘string’, } }
let realm = new Realm({schema:[userSchema],deleteRealmIfMigrationNeeded:true});
export function getAllUsers(){ try { let usersObject = realm.objects(‘User’); let userArray = [];
for(let user of usersObject){
userArray.push(user);
}
return userArray;
} catch (e) {
console.log("Error on creation",e);
}
}
Version of Realm and Tooling
- React Native: 0.55.4
- Gradle 4.7
- Gradle plugin 3.1.0
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
@Ahsan-J You are the first to report it but it can still be useful to include the link in the documentation.
If it is a common problem, Why don’t you include this in Readme so that the newcomers like me could add these instructions as well for android