Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-1063

App#getApp missing in Chrome debugging mode

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: React Native

      Goals

      A unified experience when running with or without chrome debugging mode.

      Expected Results

      Calling the getApp static method on the App class should work when in Chrome debugging mode.

      Actual Results

      An error is thrown in the Chrome console:

      TypeError: _realm.App.getApp is not a function
      

      Steps to Reproduce & Code Sample

      Run this in a React Native app running Chrome debugging mode:

      import { App } from 'realm';
      const app = App.getApp('realmjstestapp-jjhtf');
      

      Version of Realm and Tooling

      • Realm JS SDK Version: 10.2.0
      • Node or React Native: React Native in Chrome debugging mode
      • Client OS & Version: iOS, N/A
      • Which debugger for React Native: Chrome

      Additional context

      A workaround for now is to create the app using the constructor:

      const app = new App('realmjstestapp-jjhtf');
      

      As documented in the implementation of App#_setVersions we have an outstanding task of making it easier to implement the RPC for a static method on some class (App, User, Credentials, etc.): https://github.com/realm/realm-js/blob/master/lib/browser/app.js#L38-L42

            Assignee:
            kraen.hansen@mongodb.com Kræn Hansen
            Reporter:
            kraen.hansen@mongodb.com Kræn Hansen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: