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

toJSON throws an exception in v.10.6.0: Right-hand side of 'instanceof' is not an object #3860

Closed
marceloein opened this issue Jul 17, 2021 · 1 comment · Fixed by #3846
Closed
Assignees

Comments

@marceloein
Copy link

marceloein commented Jul 17, 2021

Goals

Execute successfully method toJSON on a realm object to obtain a copy of it.

Expected Results

A copy of the realm object

Actual Results

I got an exception: Right-hand side of 'instanceof' is not an object
Stack trace:
at http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.marcelo.thanmail&modulesOnly=false&runModule=true:162232:28
at Array.forEach ()
at RealmObject.value (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=XXX&modulesOnly=false&runModule=true:162223:76)
at Function.pendingDraft (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=XXX&modulesOnly=false&runModule=true:150064:32)
at parseOneMessage$ (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=XXX&modulesOnly=false&runModule=true:166918:32)
at tryCatch (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=XXX&modulesOnly=false&runModule=true:1480:19)
at Generator.invoke [as _invoke] (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=XXX&modulesOnly=false&runModule=true:1656:24)
at Generator.prototype. [as next] (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=XXX&modulesOnly=false&runModule=true:1523:23)
at tryCatch (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=XXX&modulesOnly=false&runModule=true:1480:19)
at invoke (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=XXX&modulesOnly=false&runModule=true:1556:22)

Steps to Reproduce

Execute toJSON on any realm Object using release 10.6.0.

Code Sample

var newmsg = draft.toJSON();

Probable Cause

File realm\lib\extensions.js was modified in version 10.6.0.
In line 112, a new comparsion was added. But realmConstructor.Dictionary is undefined.
Therefore, instanceof throws an exception.

realm

realm1

Version of Realm and Tooling

  • Realm JS SDK Version: 10.6.0
  • Node or React Native: React Native
  • Client OS & Version: Android 10
  • Which debugger for React Native: Chrome debugger
@niyaz234
Copy link

I am facing the same issue.
any update on this?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants