I tried to run Realm on ejected Expo(both bare and managed workflow) projects on an Android simulator. When I tried to access realm, it showed the error as show in the picture below.
My ejected Expo project's dependencies included: "expo": "~42.0.1", "react": "16.13.1", "react-native": "~0.63.4", "realm": "^10.6.0"
The code base that I used for the test is from https://github.com/osama256/React-Native-Realm/blob/master/App.js. I tried to clone the repository and run it using react native cli and it worked.
For the ejected expo projects, the object created from realm is empty, https://github.com/osama256/React-Native-Realm/blob/master/App.js. (line 25):
const newDB = async () => {
//empty object returned from realm
realm = await new Realm({ instance
path: "myrealm",
schema: [EmployeeSchema],
});
}
newDB()
...
I highly suspect that the error is came from some configuration between realm, expo and react-native. The error occur in (line 39)
realm.write(() => {
realm.create('Employee', {
id,
name,
dep
});
});
Is there anyone have similar error message and any solution to fix it? thanks for helping.
