Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main.jsbundle does not exist #38672

Closed
suntan-superman opened this issue Jul 28, 2023 · 9 comments
Closed

main.jsbundle does not exist #38672

suntan-superman opened this issue Jul 28, 2023 · 9 comments
Labels
📦Bundler Type: Expo Issues that are related to Expo CLI/EAS or other integration built on top of React Native

Comments

@suntan-superman
Copy link

Description

App runs fine on emulator but has problem during build for iOS:

eas build --profile production --platform ios

Partial results of run below:

› Generating debug worksideclient » worksideclient.app.dSYM

› Executing worksideclient » Bundle React Native code and images

Bundler cache is empty, rebuilding (this may take a minute)

❌ error: File /Users/expo/Library/Developer/Xcode/DerivedData/worksideclient-efpbaluhjmqryqdmspbuynsaebot/Build/Intermediates.noindex/ArchiveIntermediates/worksideclient/BuildProductsPath/Release-iphoneos/worksideclient.app/main.jsbundle does not exist. This must be a bug with React Native, please report it here: https://github.com/facebook/react-native/issues

▸ ** ARCHIVE FAILED **

▸ The following build commands failed:

▸ PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/expo/Library/Developer/Xcode/DerivedData/worksideclient-efpbaluhjmqryqdmspbuynsaebot/Build/Intermediates.noindex/ArchiveIntermediates/worksideclient/IntermediateBuildFilesPath/worksideclient.build/Release-iphoneos/worksideclient.build/Script-00DD1BFF1BD5951E006B06BC.sh (in target 'worksideclient' from project 'worksideclient')

▸ (1 failure)

2023-07-28 12:14:06.281 xcodebuild[4760:13790] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)

** ARCHIVE FAILED **

The following build commands failed:

PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/expo/Library/Developer/Xcode/DerivedData/worksideclient-efpbaluhjmqryqdmspbuynsaebot/Build/Intermediates.noindex/ArchiveIntermediates/worksideclient/IntermediateBuildFilesPath/worksideclient.build/Release-iphoneos/worksideclient.build/Script-00DD1BFF1BD5951E006B06BC.sh (in target 'worksideclient' from project 'worksideclient')

(1 failure)

Exit status: 65

+-------------+-------------------------+

| Build environment |

+-------------+-------------------------+

| xcode_path | /Applications/Xcode.app |

| gym_version | 2.213.0 |

| sdk | iPhoneOS16.4.sdk |

+-------------+-------------------------+

Looks like fastlane ran into a build/archive error with your project

React Native Version

0.72.3

Output of npx react-native info

System:
OS: Windows 10 10.0.19045
CPU: (4) x64 Intel(R) Core(TM) i3-8130U CPU @ 2.20GHz
Memory: 1.56 GB / 7.91 GB
Binaries:
Node:
version: 18.16.0
path: C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm:
version: 9.8.0
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowAllTrustedApps: Disabled
Versions:
- 10.0.19041.0
- 10.0.22000.0
IDEs:
Android Studio: Not Found
Visual Studio:
- 17.5.33530.505 (Visual Studio Community 2022)
Languages:
Java:
version: 11.0.16.1
path: C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin\javac.EXE
Ruby:
version: 3.2.2
path: C:\Ruby32-x64\bin\ruby.EXE
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: ^18.2.0
react-native:
installed: 0.72.3
wanted: ^0.72.3
react-native-windows: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found

Steps to reproduce

App worked fine on emulator and for expo build until adding in Amplify Auth. Now the emulator works but build fails.

Snack, screenshot, or link to a repository

Fi I simply comment out the following the build works fine:

// import { Amplify } from 'aws-amplify';
// import awsconfig from './src/aws-exports';

// Amplify.configure(awsconfig);

@github-actions github-actions bot added the Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. label Jul 28, 2023
@github-actions
Copy link

⚠️ Missing Reproducible Example
ℹ️ We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.

@cortinico cortinico added Type: Expo Issues that are related to Expo CLI/EAS or other integration built on top of React Native and removed Needs: Triage 🔍 Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Jul 31, 2023
@github-actions
Copy link

⚠️ Issue is Related to Expo
ℹ️ It looks like your issue is related to Expo and not React Native core. Please open your issue in Expo's repository. If you are able to create a repro that showcases that this issue is also happening in React Native vanilla, we will be happy to re-open.

@Tudiman555
Copy link

Tudiman555 commented Aug 21, 2023

I faced similar issue.
I resolved it by simply checking if my project was using multiple versions of metro-config.
If yes then upgrade to version which is used by react-native in my case I updated my metro-config version to 0.76.7.
This might be helpful
facebook/metro#857 (comment)

@jacquesren123
Copy link

i am facing the exact issue and i have removed all duplicated version of metro in my package

└─┬ react-native@0.71.13
└─┬ @react-native-community/cli@10.2.4
└─┬ @react-native-community/cli-plugin-metro@10.2.3
├─┬ metro-config@0.73.10
│ └── metro@0.73.10 deduped
└─┬ metro@0.73.10
└─┬ metro-transform-worker@0.73.10
└── metro@0.73.10 deduped
i even downgraded my react native version and it does not work

this is my package.json :
{
"name": "parkcity",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
"resolutions": {
"@expo/config-plugins": "~5.0.0",
"@expo/prebuild-config": "~5.0.0",
"expo-modules-autolinking": "0.10.1"
},
"engines": {
"node": ">=18"
},
"dependencies": {
"@aws-amplify/cli": "^12.1.1",
"@aws-amplify/ui-react-native": "^1.2.19",
"@react-native-async-storage/async-storage": "1.18.2",
"@react-native-community/geolocation": "^3.0.6",
"@react-native-community/netinfo": "9.3.10",
"@react-navigation/native": "^6.1.7",
"@react-navigation/native-stack": "^6.9.13",
"@reduxjs/toolkit": "^1.9.5",
"amazon-cognito-identity-js": "^6.3.1",
"aws-amplify": "^5.3.2",
"eas-cli": "^0.49.0",
"expo": "^49.0.0",
"expo-build-properties": "~0.8.3",
"expo-location": "~16.1.0",
"expo-modules-autolinking": "0.10.1",
"expo-modules-core": "~1.5.10",
"expo-status-bar": "~1.6.0",
"global": "^4.4.0",
"ngeohash": "^0.6.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.71.13",
"react-native-dotenv": "^3.4.9",
"react-native-elements": "^3.4.3",
"react-native-get-random-values": "~1.9.0",
"react-native-google-places-autocomplete": "^2.5.1",
"react-native-maps": "1.7.1",
"react-native-permissions": "^3.9.0",
"react-native-safe-area-context": "4.6.3",
"react-native-safe-area-view": "^1.1.1",
"react-native-screens": "~3.22.0",
"react-native-svg-transformer": "^1.1.0",
"react-native-url-polyfill": "^1.3.0",
"react-native-vector-icons": "^10.0.0",
"react-native-web": "~0.19.6",
"react-redux": "^8.1.1",
"tailwind-react-native-classnames": "^1.5.1"
},
"devDependencies": {
"@babel/core": "^7.20.0"
},
"private": true
}

@objectiveSee
Copy link

Same issue for me, still unable to find a solution :/

@delphinebugner
Copy link
Contributor

delphinebugner commented Sep 15, 2023

I faced this exact issue on a bare React Native project, but I managed to get through it! 🥳

It turned out to be just a cache problem. I had switched from building the version of my app that used React Native 0.72 to building an old one using React Native 0.70. Both the local and CD builds failed for the 0.70 version, with the error message main.jsbundle does not exist.

Initially, I tried to relaunch the process after cleaning the node_modules and reinstalling pods, but it still failed. I also checked the metro versions, but everything was consistent. Then, I used my favorite "let's burn everything to sanitize" tool: rn-game-over. It cleans absolutely all the caches you can think of (and even the ones you don't think of). After that, my local build succeeded. Then, I fixed my build on GitHub Actions by nuking all the caches I could find for the process.

It was probably a bit overkill. Maybe just deleting the Pods folder or Pods cache would have been enough, but anyway, it worked! I recommend it to anyone wanting to get rid of the "cache param" when debugging such an issue - one of your worst enemy,

TL;DR :

  • Fix local build: npx rn-game-over --all 🔥
  • Fix CD: nuke the caches!

@ajayranga
Copy link

Hi same issue after updating react-native to 0.72.4 from 0.70.5.
Able to fix it by build:ios command but I need to run the build:ios command every time before creating ios archive.
Which was not default behavior.
Please let know if there is any other fix for this.
And rn-game-over don't work

@ItaloVCosta
Copy link

After I forced Xcode to use the same Node.js version as my project, this issue stopped happening. To force the Node.js version, I simply set the default version to the correct one using the command:

nvm alias default 12.22.12

@eos87
Copy link

eos87 commented Sep 3, 2024

I was facing this problem when running "Archive" on Xcode. After many wasted hours of trying to figure it out, I managed to make it work by first running the app on my iPhone and then trying "Archive" once again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦Bundler Type: Expo Issues that are related to Expo CLI/EAS or other integration built on top of React Native
Projects
None yet
Development

No branches or pull requests

9 participants