-
Notifications
You must be signed in to change notification settings - Fork 584
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
[v3.7.0-alpha.2] CreatedAt must be of type 'date', got 'object' #2755
Comments
Workaround for now was to use |
@bimusiek Could you post the schema? |
@bimusiek We have release v5.0.0. Please try to upgrade. |
I will check, thanks. And do you know @kneth when are your team planning to release 4.0.0 beta with Node 13 support? 3.7.0 seems to work with newest node already. |
@kneth With 5.0.0 there is the same issue. Schema:
|
@bimusiek Thank you for the update. Could you try |
Unfortunately, the same issue. |
We use JS, Realm 5 and const schema = [
{
name: "Something",
properties: {
data: "string",
createdAt: "date",
changedAt: "date?"
}
}];
Realm.open(schema); Then create, update etc. is OK. |
It looks like the issue is how we interact with classes rather than a |
@kneth The schema I pass to Realm constructor is const realmConfig = user.createConfiguration({
schema,
schemaVersion,
sync: {
url: `~/app`,
fullSynchronization: true
}
});
const realm = new Realm(realmConfig); where schema is: export const schema = [
ConfigRealmModel.schema,
CollectionModel.schema,
CollectionItemModel.schema,
ImporterAuthenticationModel.schema,
TransferModel.schema,
TransferCollectionModel.schema,
TransferCollectionItemModel.schema,
LicenseRequestModel.schema
];
export const schemaVersion = 1; So as I understand, it is done in the same manner by passing JS object directly. I forgot to mention that I use in memory realm for Jest tests, maybe there is an issue? |
I'm also running into this issue only while using an in-memory Realm for Jest tests. |
Facing this issue myself with jest tests using inMemory Realm. Works fine on 3.6.5 |
I'm also running into this issue only in jest test (in-memory or not) the same code directly in node work fine to get it working in jest: new Date().toISOString(); |
Same having this issue in Jest only when run inmemory |
@kneth I would like to propose changing label from |
This may be related, |
I am also facing this issue with
|
Hi @kneth any update on the above issue, I am also facing same issue with below configuration. Works fine on 3.6.5.
|
@bharadwajagali No real progress. Mostly because we are migrating to MongoDB Realm Cloud as our future platform. |
this was fixed and will be part or our next release |
Hey guys, I'm facing the same issue with Realm 6.1.5 when running on Jest. This was supposed to be fixed, right @blagoev? Thanks in advance! |
@McFlyssss Yes, it should be fixed. Could you try to build from source: Currently we support node v10 which has end-of-life late April next year. After that we can bump the N-API version to 5. But building from source using node v12 (or later), you will N-API version 5 (or later), and my hypothesis is that another code plan is exercised with version 5 (or later). |
Dear @kneth , Thank you so much for your answer. Sorry I could not get back to it earlier. |
@McFlyssss It might be related to Jest (see jestjs/jest#2549) and unfortunately I don't have a simple solution (but it might be worth to read #2490 (comment)). |
FYI I tried with Realm v10 and having the exact same problem. I'll take a look at those links you shared @kneth |
@McFlyssss When you have had time to investigate, you are welcome to open a new issue with your observations. |
So finally got it working. |
Goals
Save model on node server with createdAt being
new Date()
Expected Results
Model is saved
Actual Results
Got error
Steps to Reproduce
Try to create new model on node server with
new Date()
Code Sample
Version of Realm and Tooling
The text was updated successfully, but these errors were encountered: