简体   繁体   English

在 React Native 中远程 js 调试时“未定义领域”

[英]"Realm is not defined" when remote js debugging in React Native

When I open my app, Realm works fine, it opens an instance and I logged an area to return a console.log('Realm is opened') to check if the realm is being instantiated.当我打开我的应用程序时,Realm 工作正常,它打开一个实例,我记录了一个区域以返回一个 console.log('Realm is opening') 以检查该领域是否正在被实例化。

However, when I try to use React Native's remote js debugger, the app gets stuck at the login screen and says Realm is not defined.但是,当我尝试使用 React Native 的远程 js 调试器时,该应用程序卡在登录屏幕上并说 Realm 未定义。

When I debug the issue, it fails to do Realm.open(my object schema) and gives the error stated above.当我调试问题时,它无法执行 Realm.open(my object schema) 并给出上述错误。

I'm wondering if maybe it's an issue with chrome debugger's compatibility with realm or a separate issue entirely.我想知道这可能是 chrome 调试器与领域的兼容性问题,还是完全是一个单独的问题。

I am also facing this issue.我也面临这个问题。 I realized that it is not due to chrome debugger by doing the following.通过执行以下操作,我意识到这不是由于 chrome 调试器造成的。

  1. Used another browser使用了其他浏览器
  2. Used flipper二手鳍状肢

When using flipper I did not get the Realm is undefined but the instance of the realm returned an empty object ie "{}"使用鳍状肢时,我没有得到领域是未定义的,但领域的实例返回了一个空对象,即“{}”

My react-native version 0.64.2 realm version 10.6.1我的本机版本 0.64.2 领域版本 10.6.1

The same code base works for the previous rn version.相同的代码库适用于以前的 rn 版本。 This is not a solution but maybe this will help in reproducing and resolving这不是解决方案,但也许这将有助于重现和解决

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM