Xcode sometimes opens Metro instead of Haul on first build.
See original GitHub issueCurrent Behavior
Hello 👋
So sometimes when running a debug build in xcode (usually after changing branches or after a yarn add (but this might be coincidental), running build sometimes opens the Metro packager instead of Haul, after killing it and then building again it opens Haul.
I’m also able to recreate this consistently in my Gitlab Pipeline, the runner attempts to build the IPA and upload to Fabric, each time I can see Metro starting instead of Haul, however after going into the build server manually and running the same CLI commands, it opens Haul. Super weird 😕 below is the commands xcodebuild
xcodebuild -list -workspace ios/Quiqee.xcworkspace
xcodebuild -showBuildSettings -workspace ios/Quiqee.xcworkspace -scheme QuiqeeQA
set -o pipefail && xcodebuild -workspace ios/Quiqee.xcworkspace -scheme QuiqeeQA -destination 'generic/platform=iOS' -archivePath /Network/Servers/office.quiqup.com/Users/fastlane/Library/Developer/Xcode/Archives/2018-03-02/Quiqee\ 2018-03-02\ 16.38.38.xcarchive ASSET_SUFFIX=.qa clean archive | tee /Network/Servers/office.quiqup.com/Users/fastlane/Library/Logs/gym/Quiqee-QuiqeeQA.log | xcpretty
If you could give me any guidance on how I can debug here that would be awesome! Until then I’ll keep playing around and understanding how Haul integrates with xcode under the hood 👍
Thanks!
Expected Behavior
Haul to start on first build everytime
Haul Configuration (webpack.haul.js)
module.exports = ({ platform }, { module }) => ({
entry: `./index.js`,
module: {
...module,
rules: [
{
test: /\.js?$/,
exclude: '/node_modules/',
use: [
{
loader: 'babel-loader',
},
],
},
...module.rules,
],
},
})
Your Environment
| software | version |
|---|---|
| Haul | master |
| react-native | 0.51 |
| node | 8.9.1 |
| npm or yarn | 5.5. / 1.3.2 (use yarn though) |
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)

Top Related StackOverflow Question
I’ve been digging more into this. If we are talking about
build/productionthis PR https://github.com/callstack/haul/pull/448 should polish things a bit.Actually, the behavior about luncher popup is deep in React Native (here https://github.com/facebook/react-native/blob/master/React/React.xcodeproj/project.pbxproj#L4049) as you can see there is conditional logic, where another instance is created if the packager doesn’t respond. (launchPackager.command will start Metro Bundler).
That means that if you are not running Metro / Haul, React Native will always run Metro bundler.
But I’ve seen that you can easily prevent this “packager autostart” behavior if you set
RCT_NO_LAUNCH_PACKAGERvariable. 💪 I hope it helps, I was so frustrated by this. https://twitter.com/jukben/status/1016706074878119936Maybe we should add this RCT_NO_LAUNCH_PACKAGER as a default by
haul init, not sure.Could someone do some magic with this? https://github.com/callstack/haul/issues/234