upgrade-support icon indicating copy to clipboard operation
upgrade-support copied to clipboard

Xcode - /main.jsbundle does not exist. This must be a bug with'

Open lorenzoangelini opened this issue 4 years ago • 1 comments

Environment

System: OS: macOS 10.15.2 CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz Memory: 128.54 MB / 16.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 11.10.0 - /usr/local/bin/node Yarn: 1.13.0 - /usr/local/bin/yarn npm: 6.7.0 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.9.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1 Android SDK: API Levels: 23, 27, 28, 29 Build Tools: 26.0.2, 27.0.3, 28.0.3, 29.0.2 System Images: android-19 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom_64, android-27 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 4.0 AI-193.6911.18.40.6514223 Xcode: 11.3/11C29 - /usr/bin/xcodebuild Languages: Java: 1.8.0_201 - /usr/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.0-rc.1 => 0.63.0-rc.1 npmGlobalPackages: react-native: Not Found

Upgrading version

0.61.5 => 0.63.0-rc.1

Description

We don't have no problem with the debug build, but when i run a release version in xcode, we obtain the following error:

  • [[ ! -f /Users/lorenzoangelini/Library/Developer/Xcode/DerivedData/app-dlzjkrbjxmkvpvdoutbbotxjrzkw/Build/Products/Release-iphonesimulator/app.app/main.jsbundle ]]
  • echo 'error: File /Users/lorenzoangelini/Library/Developer/Xcode/DerivedData/app-dlzjkrbjxmkvpvdoutbbotxjrzkw/Build/Products/Release-iphonesimulator/app.app/main.jsbundle does not exist. This must be a bug with'

before this error, it is showed this: Error: Unable to resolve module src/splashScreen/screen from src/_shared/routes/Navigator.tsx: src/splashScreen/screen could not be found within the project or in these directories: /Users/lorenzoangelini/project/app/app/node_modules/src/splashScreen

src/splashScreen/screen is an absolute path, that is not present into the node_modules. Why are it looking for them?

Reproducible demo

I upgraded and run a release build

lorenzoangelini avatar Jun 26 '20 08:06 lorenzoangelini

We had a similar issue when upgrading to 0.63.0 (from 0.62.3), which turned out to be an issue with the js bundling script:

When running the command from the 'Bundle React Native code and images' script in <redacted>.xcodeproj/project.pbxproj manually (with dummy env vars: CONFIGURATION=Release CONFIGURATION_BUILD_DIR=$(pwd)/ConfBuildDir UNLOCALIZED_RESOURCES_FOLDER_PATH=Res ../node_modules/react-native/scripts/react-native-xcode.sh) it failed with an issue resolving @babel/runtime/helpers/interopRequireDefault, but it was trying to resolve from <project-dir>/ios/node_modules/@babel/runtime/helpers (note: nested in ios)

Patching node_modules/react-native/scripts/react-native-xcode.sh to cd .. before calling the bundling command fixed this issue:

--- node_modules/react-native/scripts/react-native-xcode.sh
+++ node_modules/react-native/scripts/react-native-xcode.sh
 
 BUNDLE_FILE="$DEST/main.jsbundle"
 
+cd ..
 "$NODE_BINARY" $NODE_ARGS "$CLI_PATH" $BUNDLE_COMMAND \
   $CONFIG_ARG \
   --entry-file "$ENTRY_FILE" \

ci also had a fatal error: module 'yoga' in AST file ... is not defined in any loaded module map file; maybe you need to load ... ?, but it still build correctly

pretorh avatar Oct 20 '22 08:10 pretorh