Eas build for ios fails at fastlane step - no main.jsbundle:

I can succesfully build my app (Bare workflow, expo 40) with both xcode builds and npx react-native run-ios --configuration Release, but I’m still getting this error on the “Run Fastlane” step of eas build

:x: error: /Users/expo/workingdir/build/ios/main.jsbundle: No such file or directory (in target ‘redditalerts’ from project ‘redditalerts’)

My XCode shows that this file exists in my project. I also ran this script beforehand, "bundle:ios": "react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios"

Unfortunately, it’s prevented me from deploying for months (as a subscriber). I’ve sought help a few times, here last- eas build --platform ios error - #28 by notbrent

Hey @pakaplace, sorry that you’ve had troubles building with EAS thus far. Certainly not the experience we aim and expect to provide. I’m raising this issue internally and someone from the team will circle back here.

Cheers,
Adam

hey- does expo run:ios result in the same error?

It looks like your most recent build succeeded, I’m be curious to know what the root cause of this was?

please share a link to your build page. there is probably an error in the full xcode logs.

Sorry all, I lost track of this thread.

I now run this command before eas build- "bundle:ios": "react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios"

I was experiencing this problem and just solved. My steps can be found here also “main.jsbundle does not exist · Issue #32108 · facebook/react-native · GitHub” but I’ll paste for ease of use.

  1. ran “react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios”
  2. Added “main.jsbundle” to the Xcode workspace.
  3. Selected “Build Phases” and expanded “Copy Bundle Resources”
  4. Dragged (or you can click the + icon) main.jsbundle into the section
  5. In the “Bundle React Native code and images” I added the following script
  • export NODE_BINARY=node
    export PROJECT_ROOT=$PWD/…
    …/node_modules/react-native/scripts/react-native-xcode.sh
  1. I searched my repo for “main.jsbundle” and saw it was in the “.gitignore” and I removed all instances of it from the file.
  2. Now that the repo wasn’t excluding the main.jsbundle file in uploads and zips, it was able to compile!

For Expo 45+ and/or React-Native 0.69.4 users:

  1. Since the latest version of React-Native deprecated ViewPropTypes, I ran “yarn add deprecated-react-native-prop-types”
  2. Then I created a folder called “scripts” as a subdirectory of “src”
  3. I located the “index.js” file in “node_modules/react-native” and copied it into my new “src/scripts” folder
  4. In the “src/scripts/index.js” file, I replaced the Deprecated Prop Types around lines 436 with:
    // Deprecated Prop Types
    get ColorPropType(): $FlowFixMe {
    return require(“deprecated-react-native-prop-types”).ColorPropType;
    },
    get EdgeInsetsPropType(): $FlowFixMe {
    return require(“deprecated-react-native-prop-types”).EdgeInsetsPropType;
    },
    get PointPropType(): $FlowFixMe {
    return require(“deprecated-react-native-prop-types”).PointPropType;
    },
    get ViewPropTypes(): $FlowFixMe {
    return require(“deprecated-react-native-prop-types”).ViewPropTypes;
    },
    };
  5. I then added the postinstall package to run commands after yarn is completed “yarn add postinstall”
  6. I added this script to copy the edited index.js to the node_modules/react-native folder after yarn install completes
  • “patch-react-native”: “PATCH_PATH=$(pwd)/script_patches/react-native/index.js && NODE_PATH=$(pwd)/node_modules/react-native/index.js && cp $PATCH_PATH $NODE_PATH”
  1. Next add a postinstall script: “postinstall”: “yarn patch-react-native”
  2. Now with all of these steps I provided, I was able to build locally and on the eas server since the index.js files is getting replaced.