Enable React Native Debug mode in order to troubleshoot console errors, set breakpoints, profile app, and monitor network requests.
Mobile app connects to React Native Debugger successfully and I'm able to set breakpoints, profile app, and monitor network requests, view console errors
Mobile App crashes with the following error
Error: _expandEmbeddedObjectSchemas must be of type 'function', got (undefined)


yarn ios to build react native application and install on device.
Component Exception
_expandEmbeddedObjectSchemas must be of type 'function', got (undefined)
import React, { useEffect, useState } from 'react'
import { SafeAreaView, Text } from 'react-native'
import Realm from 'realm'
const App = () => {
const [realmDB, setRealmDB] = useState<Realm>()
useEffect(() => {
Realm.open({
schema: [{ name: 'Dog', properties: { name: 'string' } }],
}).then(realm => {
realm.write(() => {
realm.create('Dog', { name: 'Rex' })
})
setRealmDB(realm)
})
return () => {
if (realmDB) {
realmDB.close()
}
}
}, [])
return (
<SafeAreaView>
<Text>{realmDB ? 'Number of dogs: ' + realmDB.objects('Dog').length : 'Loading'}</Text>
</SafeAreaView>
)
}
export default App
This is happening also in android with the example of the docs. If debug mode is not enabled, works like a charm.
Thanks for reporting this.
I admit (and this is truly unfortunate) that we don't have in-depth integration tests for our library when running in Chrome debugging mode. The app that I was using to test the fix in #3411 inferred its schema, which lead to the unfortunate consequence that I didn't catch this case when solving the other issues.
I have a PR ready with a fix for this in #3446, which is currently in review and you can expect a new release as soon as this gets merged. Thank you all for your patience on this.
Most helpful comment
Thanks for reporting this.
I admit (and this is truly unfortunate) that we don't have in-depth integration tests for our library when running in Chrome debugging mode. The app that I was using to test the fix in #3411 inferred its schema, which lead to the unfortunate consequence that I didn't catch this case when solving the other issues.
I have a PR ready with a fix for this in #3446, which is currently in review and you can expect a new release as soon as this gets merged. Thank you all for your patience on this.