Missin Realm Constructor error

@Samuele_Cervietti I have submitted a PR to expo. There’s a bug in npm :slight_smile:
In the meantime, if you use npm version 6, it should download and install the template. Can you try that?
npm install -g npm@6

thank you so much for the replies, at the moment i am away from home so i cant try it, i will try it and let you know if it works. I am also waiting for your message for the updated models. Thank you

For a blank project, you should be able to do the following commands to get realm working:

expo install expo-dev-client
expo install realm
expo install @realm/react
expo run:ios 
#or
expo run:android

The package.json contains scripts for managed expo (without dev-client). They should be replaced with:

  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "ios": "expo run:ios"
  },

okay, so you don’t need the Template in theory right? The files to make the realm work can I follow the react native documentation? I don’t know if you can tell me this too but recently when I was running Expo-dev-client it was asking me to install it on the simulator or emulator

It must be installed on a device, emulator or simulator. Browser is not compatible

I don’t know if I understand correctly, do I have to install the app on the device? because I usually run the Expo server via the command you mentioned to me above and then through the Expo go application on the phone I play the app. But I guess it’s not good because it gives me the error I told you

You cannot use Expo Go with Realm or any other third party library not included in the Expo SDK. You have to use the dev-client commands: expo start --dev-client, expo run:ios, expo run:android.

ok thanks, i will definitely try

Hi, I tried to do as you said, but when I launch it in the emulator it doesn’t load me anything

Hi, I installed the template as you told me, I only have one question, I would like to know if it is mandatory to use the files that have been created for the use of the Realm Database, since I don’t have much time to study the various functions, but I would like use the examples as shown in the React native realm guide without expo

What files are you referring to exactly?

I would say all the app folder of the javascript template, what I would like to do is to use realm following the instructions on this page: https://www.mongodb.com/docs/realm/sdk/react-native/quick-start-local/.
Practically as if it were a react native app, but I would like to continue using expo, is it possible?

Yeah sure, that’s possible.

how? because I haven’t been able to get it to work yet, as it gives me Missing Realm Construct every time

For the moment you will have to use Expo SDK 44. We are working on a version of Realm that works with Expo SDK 45.

And you must use the dev-client and either expo run:ios or expo run:android.

Ok, thanks we hope it works

hi, i tried realm with expo version 44 and it all works with using expo-dev-client, now i finished the application, so i uninstalled expo-dev-client and created apk, only that I do not part anything, that you know, can realm give problems in these cases?

Which specific cases are you asking about?

I don’t know exactly, I just know that as soon as I start the application I installed, nothing starts, and since the other apps I created all work, I think the problem comes from realm, is it possible that realm gives problems after building the apk?

It shouldn’t. How did you build the apk? Expo encourages using their EAS build system. It is however possible to build it yourself: Building Standalone Apps - Expo Documentation