react-native: main.jsbundle does not exist. This must be a bug with

‘error: File /Users/user/Library/Developer/Xcode/DerivedData/NewApp-fvicxnfjlfuonigoqscurptyhntn/Build/Products/Release-iphonesimulator/NewApp.app/main.jsbundle does not exist. This must be a bug with’

React Native version:

react-native info

warn Your project is using deprecated “rnpm” config that will stop working from next release. Please use a “react-native.config.js” file to configure the React Native CLI. Migration guide: https://github.com/react-native-community/cli/blob/master/docs/configuration.md warn The following packages use deprecated “rnpm” config that will stop working from next release:

Binaries: Node: 10.18.0 - /usr/local/opt/node@10/bin/node Yarn: 1.16.0 - /usr/local/bin/yarn npm: 6.13.4 - /usr/local/opt/node@10/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman

SDKs: iOS SDK: Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1 Android SDK: API Levels: 23, 24, 25, 26, 27, 28 Build Tools: 25.0.0, 25.0.1, 25.0.2, 26.0.1, 26.0.2, 27.0.3, 28.0.0, 28.0.3, 29.0.2 System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs ARM EABI v7a, android-23 | Google APIs Intel x86 Atom_64, android-26 | Android TV Intel x86 Atom, android-26 | Google APIs Intel x86 Atom, android-26 | Google APIs Intel x86 Atom_64, android-26 | Google Play Intel x86 Atom, android-28 | Android TV Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom_64

IDEs: Android Studio: 3.5 AI-191.8026.42.35.6010548 Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild

npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.1 => 0.61.1

npmGlobalPackages: react-native-cli: 2.0.1 react-native-log-ios: 1.5.0

Steps To Reproduce

issue: ‘error: File /Users/user/Library/Developer/Xcode/DerivedData/NewApp-fvicxnfjlfuonigoqscurptyhntn/Build/Products/Release-iphonesimulator/NewApp.app/main.jsbundle does not exist. This must be a bug with’

Provide a detailed list of steps that reproduce the issue.

  1. running the app in debug mode i.e., product -> Edit Scheme -> Debug -> Debug Executable enabled - works fine.
  2. running the app release mode i.e., product -> Edit Scheme -> Release -> Debug Executable enabled - main.jsbundle does not exist. This must be a bug with

ways triaged to fix issue are below:

quit the currently running metro-bundler quit the tsc compiler quit xcode & simulator sudo rm -rf node_modules sudo yarn applying permission Read & Write manually to node_modules & all of it’s enclosed items sudo watchman watch-del-all sudo lsof -i :8081 sudo kill -9 processId open ios/ProjectName.xcworkspace

But i have not reached any solution so far. As i said before, on debug mode, it works fine, on release mode, throws the error and app did not launch

please help me out to fix this issue & go ahead

Thanks in Advance

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 16
  • Comments: 24

Commits related to this issue

Most upvoted comments

In my case, when compiling the bundle in release mode it was throwing a JS error, regarding using numbers like 15_000 instead of 15000. I had to look in the xcode logs above the actual error to see the problem, for some reason the process did not return 1 🤷


+ node /Users/stefanoeb/src/ahdy/mobile/node_modules/react-native/cli.js bundle --entry-file index.js --platform ios --dev false --reset-cache --bundle-output /Users/stefanoeb/Library/Developer/Xcode/DerivedData/ahdy-hglwxejblbjhnzbadktqltkpuzfa/Build/Intermediates.noindex/ArchiveIntermediates/Ahdy/BuildProductsPath/Release-iphoneos/ahdy.app/main.jsbundle --assets-dest /Users/stefanoeb/Library/Developer/Xcode/DerivedData/ahdy-hglwxejblbjhnzbadktqltkpuzfa/Build/Intermediates.noindex/ArchiveIntermediates/Ahdy/BuildProductsPath/Release-iphoneos/ahdy.app

                 Welcome to React Native!

                Learn once, write anywhere





error src/services/FirebaseAnalytics.ts: Unexpected token name «_000», expected punc «)» in file src/services/FirebaseAnalytics.ts at 37:21. Run CLI with --verbose flag for more details.


cd ios && pod install after npm update react-native

For me, the bundle command executed by react-native-xcode.sh tried to use the wrong index file and the solution in this Stack Overflow answer worked.

Turned out there was a syntax error in my source code, fixing the syntax error fixed the missing bundle error when archiving in Xcode. Not sure why Xcode didn’t report the syntax error while bundling for Android in command-line did.

For people who may encounter the same issue, just try to check your node or react native command could be found by XCode. Sometimes, this might be an issue if you are using nvm or fnm, especially when you are switching node versions.

This was the case for me, I was using node v14.16.1 which worked fine, then switched to v15.14.0 where it started to fail in production release.

@stefanoeb Thanks, that was my case as well. I find crazy how it works fine during development, but only fails when I try to generate a build to production. I spent an entire day today trying to figure out what was wrong until I found your message 😡

Thanks again for helping!

In my case, when compiling the bundle in release mode it was throwing a JS error, regarding using numbers like 15_000 instead of 15000. I had to look in the xcode logs above the actual error to see the problem, for some reason the process did not return 1 🤷


+ node /Users/stefanoeb/src/ahdy/mobile/node_modules/react-native/cli.js bundle --entry-file index.js --platform ios --dev false --reset-cache --bundle-output /Users/stefanoeb/Library/Developer/Xcode/DerivedData/ahdy-hglwxejblbjhnzbadktqltkpuzfa/Build/Intermediates.noindex/ArchiveIntermediates/Ahdy/BuildProductsPath/Release-iphoneos/ahdy.app/main.jsbundle --assets-dest /Users/stefanoeb/Library/Developer/Xcode/DerivedData/ahdy-hglwxejblbjhnzbadktqltkpuzfa/Build/Intermediates.noindex/ArchiveIntermediates/Ahdy/BuildProductsPath/Release-iphoneos/ahdy.app

                 Welcome to React Native!

                Learn once, write anywhere





error src/services/FirebaseAnalytics.ts: Unexpected token name «_000», expected punc «)» in file src/services/FirebaseAnalytics.ts at 37:21. Run CLI with --verbose flag for more details.

@stefanoeb May I ask how can we see the failure reason in the log?

@xilin If you’re building with Xcode check this place out: Bildschirmfoto 2021-03-23 um 19 26 43

If you’re using the CLI (like react-native run-ios) the output will be on the terminal directly, although it will be messy

Thanks. We use fastlane gym running with Jenkins, which is a little different. Will try to find it in log next time.

In my case, when compiling the bundle in release mode it was throwing a JS error, regarding using numbers like 15_000 instead of 15000. I had to look in the xcode logs above the actual error to see the problem, for some reason the process did not return 1 🤷


+ node /Users/stefanoeb/src/ahdy/mobile/node_modules/react-native/cli.js bundle --entry-file index.js --platform ios --dev false --reset-cache --bundle-output /Users/stefanoeb/Library/Developer/Xcode/DerivedData/ahdy-hglwxejblbjhnzbadktqltkpuzfa/Build/Intermediates.noindex/ArchiveIntermediates/Ahdy/BuildProductsPath/Release-iphoneos/ahdy.app/main.jsbundle --assets-dest /Users/stefanoeb/Library/Developer/Xcode/DerivedData/ahdy-hglwxejblbjhnzbadktqltkpuzfa/Build/Intermediates.noindex/ArchiveIntermediates/Ahdy/BuildProductsPath/Release-iphoneos/ahdy.app

                 Welcome to React Native!

                Learn once, write anywhere





error src/services/FirebaseAnalytics.ts: Unexpected token name «_000», expected punc «)» in file src/services/FirebaseAnalytics.ts at 37:21. Run CLI with --verbose flag for more details.

@stefanoeb May I ask how can we see the failure reason in the log?

@xilin If you’re building with Xcode check this place out: Bildschirmfoto 2021-03-23 um 19 26 43

If you’re using the CLI (like react-native run-ios) the output will be on the terminal directly, although it will be messy

For people who may encounter the same issue, just try to check your node or react native command could be found by XCode. Sometimes, this might be an issue if you are using nvm or fnm, especially when you are switching node versions.

I tried absolutely everything I could find here and anywhere else but nothing helps - always ending up with the same error:

File /Users/patrick/Library/Developer/Xcode/DerivedData/MyApp-efgagvetcbkxwfajisiotrtujzmg/Build/Products/Staging-iphoneos/MyApp.app/main.jsbundle does not exist. This must be a bug with

I even checked the dir and indeed, there is NO main.jsbundle file in there. I updated vom 0.63.2 to 0.63.4, I tried pretty much everything 😢 … can anyone help?