-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
iOS main.jsbundle does not exists – Bundle React Native code and images #25522
Comments
After debugging out the issue, I found the problem, leaving it here just in case could help anyone: On Xcode at the Then the CI finds always the correct binary regardless the node install method.
|
@carloscuesta that didn't work for me but removing the entire |
But removing the whole step is not a solution since it’s required I guess for building the application. It has a purpose, otherwise won’t be set at the build step |
You are very right. I just didn't get the build error and thought it fixed it. Any idea why your solution didn't work for me or anything you think I should test out? |
Maybe you have another problem that's not related with the bundling itself, can you bundle your application in your local machine with this step ? Take a look at #18472 @CaptainJeff |
I've got this problem upgrading react-native to 0.61.1. The build only fails when using Travis CI, compiling locally works perfectly. Did any of you find a solution? |
Yes, I was having the exact same problem as you @jaumevn this solved the issue: #25522 (comment) |
Thanks, I've just tried it and works..! |
@carloscuesta Do you still run |
Just plainly using |
@carloscuesta what does your |
Not really @StijnCoolen On the OS X machine I use the following configuration:
|
In my case, I found it's because I'm using typescript. Open Project > Build Phases > Bundle React Native code and images.
this gives me this error: The resource Apparently, by default it checks for an index.js file but since i'm using index.ts, it goes berzerk. I explicitly stated it should use index.ts and everything works fine
|
Awesome, Thank bro @carloscuesta #25522 (comment) |
$(which node) is not working in rn-0.61.5 & still I am facing this issue , |
I suggest just running the script in In my case the step had |
I renamed index.ios.js and index.android.js to .ts. Renaming back fixed the issue |
Hello! Did you found a solution? I have rn 0.61.5 too |
I ran the bundle command and then built it again and it worked for me ! |
@stanjhae @BDomantas Specifying the entry file fixes the issue for me, thanks! This kinda need a fix on the React Native side because TypeScript users tend to go pure and rename whatever In fact the first thing I did after I believe we all dug deep and changed all these files,
But |
I was stuck with this problem for a while but after taking a quick look to the export ENTRY_FILE=index.tsx
export NODE_BINARY=$(which node)
../node_modules/react-native/scripts/react-native-xcode.sh In my case, I just set the |
In my recent upgrade to 0.62 the shell script now complains about the argument, I kind of make the error disappear by changing I bet the way @leandrosimoes does it is now the only workaround. |
Upgraded react native version to 0.63.0 and build failed. |
i know this is sounds silly but my export NODE_BINARY=$(which node) that one has one dot (./node) before node, i didn't pay attention, need to be double dot (../node) React Native Environment Info: |
Also upgraded to 0.63.0 and started having this issue. I managed to get the bundle in by using this command:
However, my archived app does not contain the assets from my src folder. Everything works fine on development build |
For those still running into issues in React Native 0.63: #18472 (comment) |
if you are using module-resolver
Note that this might break if the source of this is a bug in 0.63.0, so you may need to undo this on a future release. |
I was having the same problem as you. I can bundle the app.But LaunchScreen.storyboard can't load the launchImage. |
The only way I managed to solve this issue is by archiving the app locally in XCode to find the problem. Looking at the logs will show you the exact problem. Something must be wrong on the JS side (for me, (I reverted all changes made to the build phase in this thread) |
None of the above fixed it for me on 0.63.2, but it works with this PR, it'll probably be released soon #29477 |
I also faced the same issue and try to amend the script file or the Bundle React Native code and images section in XCode also didn't help. I found that there are two versions of node js installed in my Macbook. One located in the /opt/local/bin (ver 10) and the other one located in /usr/local/bin (version 12). My bash shell is using the /opt/local/bin by default. When I try to update the node to latest version (14.14) it only update the version located in /usr/local/bin. End up, I edit my bash shell profile in $HOME/.bash_profile to add in the /usr/local/bin into my PATH environment variable as below. export PATH="/usr/local/bin:${PATH}" After edit the profile, I try to run the app via command line After that, I restart XCode again and archive the project again and managed to completed the archiving without any issue. Hope my finding will help other with similar issue. Good luck! |
@carloscuesta I tried to do that, but I get this erros
|
In my cases, I change crypto-js library version from 4.0.0 to 3.3.0 in package json and everything worked. |
Hello!
I have updated an app from
[email protected]
to[email protected]
and I'm having problems with the iOS build stepBundle React Native code and images
. The problem is that when the build gets on this step on the CI machine, fails automatically throwing the following error:What bothers me is the thing that I can make a bundle on the CI machine using the
react-native bundle
command without any problems or issues So I can safely assume that there's no problem with the bundle creation.From what I've read at #18472, I tried the proposed solutions such as ensuring that the version of node it's specified by nvm as default, tried to use another version of Xcode, tried to use a newer version of Node. Nothing fixed the problem. Also I've tried to debug the issue and seems that this command it's not being executed. The thing is that this script itself doesn't give any output of what happened on success or fail.
react-native/scripts/react-native-xcode.sh
Lines 121 to 129 in c20070f
This is the error log:
React Native Environment
I'm running the builds on a Travis CI machine and before the bump to
0.59.9
this never happened.Steps To Reproduce
Describe what you expected to happen:
I expect that the
main.jsbundle
file is created successfully through the step of Bundle React Native code and images as it does if I do it manually using thereact-native bundle
command.Thanks 🙏
The text was updated successfully, but these errors were encountered: