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

Realm is not defined in debug modus #3991

Closed
Acetyld opened this issue Oct 3, 2021 · 7 comments · Fixed by #4109
Closed

Realm is not defined in debug modus #3991

Acetyld opened this issue Oct 3, 2021 · 7 comments · Fixed by #4109
Assignees

Comments

@Acetyld
Copy link

Acetyld commented Oct 3, 2021

How frequently does the bug occur?

All the time

Description

Using any kind of debugger is causing:
LogBox.js:173 Possible Unhandled Promise Rejection (id: 0):
ReferenceError: Realm is not defined
ReferenceError: Realm is not defined

Chrome,

Stacktrace & log output

index.bundle?platfor…g.reactjs.na…:23154 Possible Unhandled Promise Rejection (id: 0):
ReferenceError: Realm is not defined
ReferenceError: Realm is not defined
    at Proxy.method (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.Realm:120435:90)
    at Function.from (<anonymous>)
    at _iterableToArray (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.Realm:3511:116)
    at _toConsumableArray (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.Realm:3495:131)
    at http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.Realm:109584:50
    at tryCallOne (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.Realm:28713:14)
    at http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.Realm:28814:17
    at http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.Realm:29405:21
    at _callTimer (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.Realm:29301:9)
    at _callReactNativeMicrotasksPass (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.Realm:29340:7)

Can you reproduce the bug?

Yes, always

Reproduction Steps

"react": "17.0.2",
"react-native": "0.66.0",
"realm": "^10.8.0"

Any debug modes is causing this, even a fresh project

Version

"realm": "^10.8.0",

What SDK flavour are you using?

Local Database only

Are you using encryption?

No, not using encryption

Platform OS and version(s)

Newest

Build environment

Which debugger for React Native: ..

@Acetyld
Copy link
Author

Acetyld commented Oct 3, 2021

Found a fix using some older github issues
**I changed:**
const isSet = (this.constructor && this.constructor.name === "Set") || this instanceof Realm.Set;
**to:**
const isSet = (this.constructor && this.constructor.name && this.constructor.name === 'Set');

Inside relam/lib/collection-methods.js.

Can you guys accept the old pull request or fix this ASAP?
Otherwise no debugger will work.

@fronck
Copy link

fronck commented Oct 4, 2021

@Acetyld Which debugger are you using to trigger this issue?

@Acetyld
Copy link
Author

Acetyld commented Oct 4, 2021

It happens with every debugger.
Safara, chrome debugger
also with chrome debugger and even with flipper.,

@takameyer
Copy link
Contributor

@Acetyld Debugging in Safari should work if you do not activate debugging mode (do not press Debug with Chrome). Theres a good blog post on how to do this. Let us know if works.

@Acetyld
Copy link
Author

Acetyld commented Oct 5, 2021

Yhea i tried that. but its not due to chrome debugger. Its als in flipper
I changed:
const isSet = (this.constructor && this.constructor.name === "Set") || this instanceof Realm.Set;
to:
const isSet = (this.constructor && this.constructor.name && this.constructor.name === 'Set');

This fixed the issue.

I also saw a other post complaning about the pull you deleted this #3843.

@fronck
Copy link

fronck commented Nov 29, 2021

@Acetyld We haven't been able to reproduce the issue with neither lldb nor Safari. We do have a code cleanup PR in #4109 .
Would you be able to provide reproduction code, or try out the fix in the PR to make sure it fixes the issue?

@fronck fronck self-assigned this Nov 29, 2021
@fronck
Copy link

fronck commented Dec 16, 2021

This issue should be fixed by #4109 .
Thanks for reporting.

@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
Development

Successfully merging a pull request may close this issue.

3 participants