question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Xcode sometimes opens Metro instead of Haul on first build.

See original GitHub issue

Current 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:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jukbencommented, Jul 10, 2018

I’ve been digging more into this. If we are talking about build/production this 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_PACKAGER variable. 💪 I hope it helps, I was so frustrated by this. https://twitter.com/jukben/status/1016706074878119936

Maybe we should add this RCT_NO_LAUNCH_PACKAGER as a default by haul init, not sure.

0reactions
jukbencommented, Jul 9, 2018

Could someone do some magic with this? https://github.com/callstack/haul/issues/234

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue with opening IOS Simulator | Apple Developer Forums
Hi, I am developing an App in React Native for this i need Xcode. However when i start my Expo Developer Tool Metro...
Read more >
React-Native IOS real device does not connect to Metro server
In your xcode go to: Window -> Devices and Simulators -> click on your iPhone-> make sure Connect via network checkbox is checked....
Read more >
CRFM Benchmarking
Cesc Fabregas makes his first return to his former club in the clash . Arsenal manager Arsene Wenger wants fans to respect ex-players...
Read more >
Troubleshooting build errors and crashes - Expo Documentation
Sometimes it's necessary to open the full Xcode logs to find the information that you need; for example, if the JavaScript build failed...
Read more >
Setting up the development environment - React Native
This page will help you install and build your first React Native app. ... to install Xcode or set up your Android development...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found