question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Realm in React native - TypeError: Undefined is not a function (evaluating _iterator3[typeof Symbol === "function"...

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
knethcommented, Jun 19, 2018

@Ahsan-J You are the first to report it but it can still be useful to include the link in the documentation.

0reactions
Ahsan-Jcommented, Jun 18, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error in opening a pre-filled realm db in react-native app
I've followed the steps in the react-native realm docs, however, I'm facing a strange ... TypeError: undefined is not a function at ?anon_0_ ......
Read more >
Realm React Native and Node.js - MongoDB
This project hosts the JavaScript versions of Realm. Currently we support React Native (both iOS & Android), Node.js and Electron (on Windows, ...
Read more >
How to use the realm.open function in realm - Snyk
To help you get started, we've selected a few realm.open examples, based on popular ways it is used in public projects.
Read more >
realm.Realm.write JavaScript and Node.js code examples
index.js/ReactNativeRealmScreen/componentWillMount. componentWillMount() { Realm.open({ schema: [{name: 'Band', properties: {name: 'string', ...
Read more >
Build a React Native Mobile App with Realm & MongoDB
LINKS 🔗Read the Realm docs: https://trymongodb.com/ realm -docsStart the React Native tutorial: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found