-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Reflect.construct requires the first argument to be a constructor #3110
Comments
Please fill out our issue template in full so we can see what the error is. Currently the issue does not contain any error. |
My bad the error is in the title. thanks |
I'm having same issue. I've seen it when I tried to upgrade to RN 62 few weeks ago (and so rolled back). Recently I upgraded to RN 63 and have it again. GoalsUse classes with instance methods for my models, while connecting to realm. Expected ResultsRealm should open, data should be fetched correctly and instance methods work on instances of the models returned by realm. Actual ResultsGetting error in terminal: TypeError: Reflect.construct requires the first argument be a constructor Steps to ReproduceRunning an example below and using class instead of schema, in Realm.open. Code Sampleclass Base extends Realm.Object {
debug() {
log.debug('Area debug info', [`id=<${this.id}>`, `label=<${this.label}>`]);
}
}
class AreaPlain extends Base {}
class Area extends Base {
static schema = {
name: 'Area',
primaryKey: 'id',
properties: {
id: 'string',
label: 'string'
},
};
static all(realm) {
return realm.objects(Area.schema.name).sorted('label');
}
}
const area = new AreaPlain();
area.id = 'all';
area.label = 'All areas';
Realm.open([Area]); Version of Realm and Tooling
Libs versions at the point when my app worked (only the ones I feel are relevant). More details of the upgrade process are available at official upgrade guide for these two versions Worked on:
Does not work on:
While writing this report, I somehow managed to make it work. I'm still confused what happened, and why. And I'm hoping this is not false positive. My app now runs just fine with the versions of libs it was previously failing on. What I did:
@uendar could you try the steps above? At this point, it looks like some intermittent issue caused by caching / build inconsistencies. |
@rdamborsky can you try with |
I'm currently still having this issue on version 6.1.5 |
I am getin this error when i run : react-native run-android
First the app opens correctly and after 3 sec it shows me this error.
I have never had this before. I am using last realm version 6.0.4
Even with older versions is the same issue.
I have lot of schemas that i import in an index file :
As i said there are lot of schemas but i follow the same rule
The text was updated successfully, but these errors were encountered: