title: Realm error - _constructor must be of type 'function', got (undefined)
body: <p>I am trying to setup Realm DB locally with my react native application but there seems to be an error that I cannot figure out a reason for. I have followed the <a href="https://realm.io/docs/javascript/latest" rel="noreferrer">documentation</a> and the guide <a href="https://www.youtube.com/watch?v=2sI64vaHF98&amp;t=0s&amp;list=PLRXaEJmfbSuhuKe2LNvjwIzKY3bMIW1U-&amp;index=2" rel="noreferrer">here</a>.</p>
  
  <p>My Code.</p>
  
  <pre><code>import Realm from 'realm';
  
  export const ConfigSchema = {
      name: 'Config',
      primaryKey: 'key',
      properties: {
          key: 'string',
          value: 'string'
      }
  };
  
  export const databaseOptions = {
      path: 'myappreactnative.realm',
      schema: [ConfigSchema],
      schemaVersion: 0
  };
  
  export const insertNewConfig = (newConfig) =&gt; new Promise((resolve, reject) =&gt; {
      Realm.open(databaseOptions).then(realm =&gt; {
          // realm.create('Config', newConfig);
          // resolve(newConfig);
          console.log(realm);
      }).catch((error) =&gt; reject(error))
  });
  </code></pre>
  
  <p>I'm calling <code>insertNewConfig</code> from here,</p>
  
  <pre><code>let config = {
      key: 'instanceUrl',
      value: 'myurl.domain.value'
  };
  
  insertNewConfig(config).then((result) =&gt; {
      console.log(result);
  }).catch((error) =&gt; {
      console.log(error);
  });
  
  this.props.navigation.navigate('Login', {});
  </code></pre>
  
  <p>The error is there at the <code>Realm.open(databaseOptions)</code> line. First I though the error was with <code>realm.create</code> but later realized the original line.</p>
  
  <p>The error showing is like this.</p>
  
  <pre><code>Error: _constructor must be of type 'function', got (undefined)
      at sendRequest (rpc.js:263)
      at Object.createRealm (rpc.js:62)
      at new Realm (index.js:102)
      at Function.open (extensions.js:110)
      at eval (eval at &lt;anonymous&gt; (MetroClient.js:63), &lt;anonymous&gt;:29:22)
      at tryCallTwo (core.js:45)
      at doResolve (core.js:200)
      at new Promise (core.js:66)
      at insertNewConfig (eval at &lt;anonymous&gt; (MetroClient.js:63), &lt;anonymous&gt;:28:12)
      at Object.SelectInstanceScreen._this.continueLogin [as onPress] (eval at &lt;anonymous&gt; (MetroClient.js:63), &lt;anonymous&gt;:74:37)
  </code></pre>
  
  <p>Seems that the <code>open()</code> function must be called as a function (_constructor must be of type 'function') but it is obvious that <code>open()</code> is called as a function.
  Thanks in advance.</p>