Skip to content
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

toEjson() throws "Missing encoder for type RealmValue" #1757

Closed
lhengl opened this issue Jul 24, 2024 · 3 comments · Fixed by #1736
Closed

toEjson() throws "Missing encoder for type RealmValue" #1757

lhengl opened this issue Jul 24, 2024 · 3 comments · Fixed by #1736

Comments

@lhengl
Copy link

lhengl commented Jul 24, 2024

What happened?

The toEjson() function throws when using RealmValue. The following error will be encountered:

Missing encoder for type RealmValue

Repro steps

Define a Realm model with a RealmValue as a field.

Instantiate the model and then call the toEjson() function on the object.

Version

Flutter 3.22.2

What Atlas Services are you using?

Atlas Device Sync

What type of application is this?

Flutter Application

Client OS and version

Any

Code snippets

class $MyClass {
@PrimaryKey()
@mapto('_id')
late ObjectId id;

late RealmValue realmValue;
}

// instantiate and call toEjson()
final object = MyClass();

// this throws an error: "Missing encoder for type RealmValue"
object.toEjson();

Stacktrace of the exception/crash you're getting

No response

Relevant log output

No response

Copy link

sync-by-unito bot commented Jul 24, 2024

➤ PM Bot commented:

Jira ticket: RDART-1076

@nielsenko nielsenko self-assigned this Jul 29, 2024
@nielsenko
Copy link
Contributor

nielsenko commented Jul 29, 2024

Thanks for reporting. This happens to be a duplicate, so I will close this one.

@nielsenko
Copy link
Contributor

Duplicate of #1737

@nielsenko nielsenko marked this as a duplicate of #1737 Jul 29, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants