Goals
Debug code with Remote JS Debugging.
Expected results
Debug code with Remote JS Debugging.
Actual results
Red error screen with title 'Unknown execution context'

Steps to reproduce
react-native init TestRealmnpm install --save realm or yarn add realmreact-native link realmimport Realm from 'realmreact-native run-iosEnable Remote JS Debugging
Code sample that highlights the issue
https://github.com/aparedes/TestRealm
Version of Realm 1.0.2 / Xcode 8.2.1 / OSX 10.11.6
Hi @aparedes did you run react-native link realm? This should be noted in the error message, I need to fix that..
Yes, I did run react-native link realm.
I only get this error with the Remote JS Debugging activated, otherwise it works and I can write and read to/from the Realm database.
I see, in that case something else is wrong. Thank you for reporting.
I got this issue, too. Does it fix yet?
I tried to reproduce this problem, but its to be running fine on my computer, tried both iPhone SE and iPhone 6 simulators.
Looking at the getContext here here, it seems to only work when user agent is set to contain Chrome. What debugger are you using? (@aparedes & @anonymoushitec)
Realm 1.0.2, Xcode 8.2.1, OSX 10.12.3
I'm using Realm 1.0.2 / Xcode 8.2.1 / OSX 10.11.6 / React-Native 0.41.2 / Chrome 56
I can't reproduce it anymore, could be something with Xcode, that needed a restart or something.
I got this issue, too. if close the "Remote JS Debugging', it's works well.
if (typeof Realm !== 'undefined') {
if (typeof navigator !== 'undefined' &&
navigator.product === 'ReactNative') { // eslint-disable-line no-undef
return 'reactnative';
}
return 'jscore';
}
when Remote JS Debugging is off, the fragment return 'reactnative'. if remote js debugging is on, return undefined, so throw Error("Unknown execution context");
I had the same, but tried again a few days later and it worked. I didn't change a thing.
Do you have the debugger with device toolbar on?![]()
It seems that is the one causing the problems. Or at least for me.
I have the same problem
what do you mean by the debugger with the (the picture you provided) on?
do we have different debuggers inside of Xcode?
I mean in Chrome Dev Tools
When you are in the phone or simulator, you enable the debugging and it opens chrome. In chrome, if you press the device toolbar on it shows the web view in a "mobile" view. That seemed to be causing some issues for me. When it was disabled, it was acting normal
I am having the same issue. It only happens when I am debugging with Nuclide debugger. Works fine with dubugging off and when dubugging routed through Chrome.
running react-native run-ios again, worked for me.
Also getting this error when trying to run on (iOS) device. Haven't changed anything, but after working on a different project and trying to run this one again it just started failing :(
I have the same problem with debugging off. Nothing works.
Tried the following:
Btw, using node version 6.10 as recommended in realm docs.
@oliviachang29 I am sorry to hear that. If you are able to provide us with a repro-case in some form we can try taking a look at it.
Got it working after starting on a fresh new project. Not sure what specifically got it to work.
I am not running in debug mode. Still, I am getting the same


Why is this closed? It's still a problem.
I am also facing same problem even after running "react-native link realm"
Most helpful comment
Do you have the debugger with device toolbar on?
It seems that is the one causing the problems. Or at least for me.