title: React Native build failed - "Error: While trying to resolve module `react-native-firebase`"
body: <p>I am upgrading from RN 0.55.3 to 0.57.0 (manually).</p>
  
  <p>After running <code>react-native run-ios</code> or <code>react-native run-android</code> I'm now getting the error:</p>
  
  <pre><code>error: bundling failed: Error: While trying to resolve module `react-native-firebase`
  </code></pre>
  
  <p>I already tried re-running <code>react-native link react-native-firebase</code> (<a href="https://stackoverflow.com/questions/53271503/error-bundling-failed-while-trying-to-resolve-module-react-native-firebase">per this post</a>) as well as deleting node_modules and re-running <code>yarn</code> and neither worked.</p>
  
  <p>Full error report:</p>
  
  <pre><code>error: bundling failed: Error: While trying to resolve module `react-native-firebase` from file `MyApp/src/screens/StarterPage.js`, the package `MyApp/node_modules/react-native-firebase/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`MyApp/node_modules/react-native-firebase/dist/index.js`. Indeed, none of these files exist:
  
    * `MyApp/node_modules/react-native-firebase/dist/index.js(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
    * `MyApp/node_modules/react-native-firebase/dist/index.js/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
      at ResolutionRequest.resolveDependency (MyApp/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:95:15)
      at DependencyGraph.resolveDependency (MyApp/node_modules/metro/src/node-haste/DependencyGraph.js:238:485)
      at Object.resolve (MyApp/node_modules/metro/src/lib/transformHelpers.js:180:25)
      at dependencies.map.result (MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:311:29)
      at Array.map (&lt;anonymous&gt;)
      at resolveDependencies (MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:307:16)
      at MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:164:33
      at Generator.next (&lt;anonymous&gt;)
      at step (MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:266:307)
      at MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:266:467
   BUNDLE  [ios, dev] ../../index.js ▓▓▓▓▓▓▓▓▓▓▓░░░░░ 73.4% (796/929)::1 - - [04/Jun/2019:00:27:03 +0000] "GET /index.bundle?platform=ios&amp;dev=true&amp;minify=false HTTP/1.1" 200 - "-" "MyApp/79 CFNetwork/978.0.7 Darwin/18.6.0"
   BUNDLE  [ios, dev] ../../index.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░ 92.7% (904/939)
  </code></pre>
  
  <p>I checked and all these files are in <code>node_modules/react-native-firebase</code>. For instance, <code>/dist/index.js</code> is:</p>
  
  <pre><code>import firebase from './modules/core/firebase';
  export default firebase;
  export * from './modules/core/firebase';
  /*
   * Export App types
   */
  </code></pre>
  
  <p>My package.json</p>
  
  <pre><code>{
    "name": "MyApp",
    "version": "2.1.27",
    "private": true,
    "scripts": {
      "clean:android": "./android/gradlew -p android/ clean &amp;&amp; git clean -dfX -e *.iml android/build android/app/src",
      "bundle:android": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res",
      "build:android:release": "yarn clean:android &amp;&amp; yarn bundle:android &amp;&amp; ./android/gradlew -p android/ assembleRelease",
      "run:android:release": "react-native run-android --variant=release",
      "run:android:debug": "react-native run-android",
      "test": "jest",
      "android-linux": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res &amp;&amp; react-native run-android",
      "eslint": "eslint —-ext .js ./src/",
      "eslint:fix": "eslint --fix ./src/",
      "flow": "flow",
      "flow-stop": "flow stop",
      "postinstall": "sed -i '' \"s/version.startsWith('iOS')/version.startsWith('com.apple.CoreSimulator.SimRuntime.iOS')/g\" ./node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js"
    },
    "dependencies": {
      "@babel/runtime": "^7.4.5",
      "@react-native-community/async-storage": "^1.3.3",
      "adm-zip": "^0.4.11",
      "axios": "^0.18.0",
      "babel-plugin-transform-remove-console": "^6.9.4",
      "base-64": "^0.1.0",
      "d3-format": "^1.3.0",
      "hoist-non-react-statics": "^3.0.1",
      "lodash": "^4.17.11",
      "moment": "^2.22.2",
      "moment-timezone": "^0.5.17",
      "piexifjs": "^2.0.0-beta.7",
      "plist": "^3.0.1",
      "prop-types": "^15.6.2",
      "react": "16.5.0",
      "react-native": "0.57.0",
      "react-native-animatable": "^1.3.0",
      "react-native-camera": "^1.6.3",
      "react-native-carrier-info": "^1.0.1",
      "react-native-circular-progress": "git+https://git@github.com/bartgryszko/react-native-circular-progress.git",
      "react-native-confetti": "^0.1.0",
      "react-native-contacts": "^2.2.3",
      "react-native-country-picker-modal": "^0.5.1",
      "react-native-datepicker": "^1.7.2",
      "react-native-default-preference": "^1.3.1",
      "react-native-device-info": "^0.21.5",
      "react-native-dotenv": "^0.2.0",
      "react-native-extended-stylesheet": "^0.8.1",
      "react-native-fbsdk": "^0.8.0",
      "react-native-firebase": "5.2.0",
      "react-native-fs": "^2.13.3",
      "react-native-image-crop-picker": "^0.24.0",
      "react-native-keyboard-aware-scrollview": "^2.0.0",
      "react-native-localization": "1.0.9",
      "react-native-maps": "^0.22.1",
      "react-native-mixpanel": "^1.1.1",
      "react-native-modalbox": "^1.4.2",
      "react-native-permissions": "^1.1.1",
      "react-native-popover-tooltip": "^1.1.4",
      "react-native-popup-menu": "^0.14.0",
      "react-native-share": "^1.1.3",
      "react-native-snap-carousel": "^3.7.5",
      "react-native-sound": "^0.10.9",
      "react-native-svg": "^9.2.4",
      "react-native-svg-charts": "^5.2.0",
      "react-native-swiper": "^1.5.13",
      "react-native-version-number": "^0.3.4",
      "react-native-webview-android-file-upload": "git+https://git@github.com/andreipfeiffer/react-native-webview-android-file-upload.git",
      "react-navigation": "^1.5.11",
      "xcode": "^1.0.0"
    },
    "devDependencies": {
      "babel-jest": "24.7.1",
      "babel-preset-react-native": "5.0.2",
      "eslint-config-rallycoding": "^3.2.0",
      "flow-bin": "^0.67.1",
      "jest": "24.7.1",
      "metro-react-native-babel-preset": "0.53.1",
      "react-test-renderer": "16.5.0"
    },
    "jest": {
      "preset": "react-native"
    },
    "rnpm": {
      "assets": [
        "./assets/fonts/"
      ]
    }
  }
  </code></pre>
  
  <p>I expect my app to run in the emulator (iOS) or on my phone (Android).</p>