Closed tomduncalf closed 1 month ago
Running the following code in Node results in libc++abi: terminating with uncaught exception of type Napi::Error: domain.enter is not a function
libc++abi: terminating with uncaught exception of type Napi::Error: domain.enter is not a function
const Realm = require("realm"); const taskSchema = { name: "Task", primaryKey: "_id", properties: { _id: "objectId", description: "string", isComplete: { type: "bool", default: false }, createdAt: "date", userId: "string", }, }; const app = new Realm.App({ id: "pbs-test-pwvrg" }); const user = await app.logIn(Realm.Credentials.anonymous()); const realm = await Realm.open({ schema: [taskSchema], sync: { user, partitionValue: "myPartition", }, });
I found that if I change this line to: Function<T>::callback(protected_ctx, protected_callback, protected_this, 2, callback_arguments); (i.e. add protected_this), the error goes away. But I assume this is a symptom of something else being wrong…
Function<T>::callback(protected_ctx, protected_callback, protected_this, 2, callback_arguments);
protected_this
That code was last changed in this PR by Mathias to prep for Hermes from June 2021.
I also see the issue on v11.
v11
Your proposed solution makes sense as it sets this to a proper value instead of an empty object ({}).
this
{}
With v12 out we are rewritten this part of the code base, and I believe that it has fixed the issue.
Running the following code in Node results in
libc++abi: terminating with uncaught exception of type Napi::Error: domain.enter is not a function
I found that if I change this line to:
Function<T>::callback(protected_ctx, protected_callback, protected_this, 2, callback_arguments);
(i.e. addprotected_this
), the error goes away. But I assume this is a symptom of something else being wrong…That code was last changed in this PR by Mathias to prep for Hermes from June 2021.
I also see the issue on
v11
.