title: Realm and React error. Can't resolve 'react-native' in app created with create-react-app
body: <p>I'm attempting to add the Realm package to a project created with create-react-app. I simply run the create script, install the project, then install realm. When I attempt to import or require 'realm' I get a <em>Can't resolve 'react-native'</em> error.</p>
  
  <pre><code>npx create-react-app my-app
  cd my-app
  npm i
  npm i --save realm
  npm start
  </code></pre>
  
  <p>At this point, if I attempt to import realm anywhere in the project, for instance by adding:</p>
  
  <pre><code>import Realm from 'realm';
  </code></pre>
  
  <p>or</p>
  
  <pre><code>Realm = require('realm');
  </code></pre>
  
  <p>to App.js or Index.js </p>
  
  <p>I get the following error.</p>
  
  <pre><code>./node_modules/realm/lib/browser/index.js
  Module not found: Can't resolve 'react-native' in '/Users/scolobey/Desktop/Projects/realm-blog/node_modules/realm/lib/browser'
  </code></pre>
  
  <p>As far as I have been able to tell, this seems to be related to webpack. Opening the console on this error page, I see:</p>
  
  <pre><code>./node_modules/realm/lib/browser/index.js
  Module not found: Can't resolve 'react-native' in '/Users/scolobey/Desktop/Projects/javascript/my-app/node_modules/realm/lib/browser'
  console.&lt;computed&gt; @ index.js:1
  r @ backend.js:6
  handleErrors @ webpackHotDevClient.js:173
  push../node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:212
  </code></pre>