title: Bundlejs error on release build in Xcode (react-native)
body: <p>For some reason I am getting the following error when building a release version of my application via react-native.</p>
  <blockquote>
  <p>*** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: t.typeof is not a function. (In 't.typeof(&quot;function&quot;==typeof Symbol?Symbol.iterator:&quot;@@iterator&quot;)', 't.typeof' is undefined) (/Users/../THEAPP.app/main.jsbundle:11)', reason: 'Unhandled JS Exception: t.typeof is not a function. (In 't.typeof(&quot;function...'</p>
  </blockquote>
  <p>This is the source of the code that has the above error that I found in my bundlejs file:</p>
  <pre><code>!(function(e){&quot;use strict&quot;;var r,t=e.babelHelpers={};t.typeof=&quot;function&quot;==typeof Symbol&amp;&amp;&quot;symbol&quot;===t.typeof(&quot;function&quot;==typeof Symbol?Symbol.iterator:&quot;@@iterator&quot;)?
  </code></pre>
  <p>I have tried both of these methods of a release build:</p>
  <ol>
  <li>Making bundle by editing the Scheme to be a Release bundle</li>
  <li>Export a bundle myself by using the following: <code>react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios </code></li>
  </ol>
  <p>I get the same error for both of these. And of course, this is after I change my <strong>AppDelegate.m</strong> to the following:</p>
  <pre><code>//jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@&quot;index&quot; fallbackResource:nil];
  jsCodeLocation = [[NSBundle mainBundle] URLForResource:@&quot;main&quot; withExtension:@&quot;jsbundle&quot;];
  </code></pre>
  <hr />
  <p>I also followed <a href="https://github.com/facebook/react-native/issues/19788#issuecomment-399327751" rel="nofollow noreferrer">someone's response</a> from Github issues and tried the following, but got another separate issue entirely after the fact:</p>
  <p>I did:</p>
  <pre><code>npm uninstall -g babel-preset-env
  npm install --save @babel/preset-env
  </code></pre>
  <p>Added this to my package.json file</p>
  <pre><code> &quot;babel&quot;: { &quot;presets&quot;: [&quot;@babel/preset-env&quot;, &quot;react-native&quot;] }
  </code></pre>
  <p>And created a <code>.babelrc</code> file in my root project with:</p>
  <pre><code>{ &quot;presets&quot;: [&quot;@babel/preset-env&quot;, &quot;react-native&quot;] }
  </code></pre>
  <p>Then get this on an Xcode build:</p>
  <p><a href="https://i.stack.imgur.com/osWGX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/osWGX.png" alt="enter image description here" /></a></p>
  <h1>Environment</h1>
  <ul>
  <li><strong>OS</strong>: macOS High Sierra 10.13.4</li>
  <li><strong>Node</strong>: 9.11.1</li>
  <li><strong>npm</strong>: 5.6.0</li>
  <li><strong>Watchman</strong>: 4.9.1</li>
  <li><strong>Xcode</strong>: Version 9.4 (9F1027a)</li>
  <li><strong>react</strong>: 16.3.1</li>
  <li><strong>react-native</strong>: 0.55.4</li>
  </ul>