replacing "react-native bundle" calls by "react-native rnx-bundle" results in huge console logs
Thanaen opened this issue · 6 comments
What happened?
Hello,
I have set up rnx-kit to bundle my application.
I replaced the react-native start
scripts with react-native rnx-start
, and it works perfectly.
I also wanted to replace the calls to react-native bundle
with react-native rnx-bundle
. (For Android, I used bundleCommand = "rnx-bundle"
in build.gradle, and for iOS I used export BUNDLE_COMMAND=rnx-bundle
in the bundle phase on XCode.
For Android, this works, but there is a problem: the whole generated js bundle is logged in the console, and I suspect it is logged several times in a row because my log file was over 300 megabytes at the end of the build.
For iOS, when trying to archive, it also logs a lot of lines related to the source code, but the bundle step never finishes (as if the bundle script was still in "waiting for input" mode).
So several questions:
- Can we use
rnx-bundle
as a drop-in replacement forreact-native bundle
? - Did I forget some parameters that would have allowed to avoid these logs ?
If we can't replace react-native bundle
directly by react-native rnx-bundle
, how should we use it?
Affected Package
@rnx-kit/cli
Version
0.16.9
Which platforms are you seeing this issue on?
- Android
- iOS
- macOS
- Windows
System Information
For some reasons, running "npx react-native info" returns "unknown command 'info'"
Steps to Reproduce
- Create a new react-native project
- Setup rnx-kit bundling (https://microsoft.github.io/rnx-kit/docs/guides/bundling#setting-up-the-tools)
- In "./android/app/build.gradle", set "bundleCommand" to "rnx-bundle"
- For iOS, in XCode, add this line to the bundle phase script: "export BUNDLE_COMMAND=rnx-bundle"
- Generate an Android APK, and an iOS Archive
Code of Conduct
- I agree to follow this project's Code of Conduct
Same issue for me
Do you use Hermes? Do these "huge console logs" come from the Hermes compiler? If so, try this workaround to disable warnings: #2416 (comment)
We can't control the console output of Hermes. If you think this is a real issue, you should file it on their GitHub instead.
I do use Hermes!
I will try that, thanks! Do you think this is what is blocking the bundle in XCode? (maybe I should create a new issue for this)
For the blocking bundle issue, do you have a repro? I've not seen this myself so having a repro would help us investigate.
At this time, I did not publish a repro project.
I might try to put one up next week.
The repro steps are pretty simple:
- In the bundle phase of XCode, add the line
export BUNDLE_COMMAND=rnx-bundle
, then generate an archive.
I'll try to set one up as soon as I have some free time (and a Macbook available!)
For fix and workaround, see #2416 (comment).