Skip to content

SKIP_BUNDLING prevents generating packager host IP for debugging on iOS devices #20553

@keatongreve

Description

@keatongreve

Duplicate of #17301, which was closed due to being stale.

Environment

React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.5
      CPU: x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
      Memory: 165.44 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 9.11.2 - ~/.nvm/versions/node/v9.11.2/bin/node
      Yarn: 1.9.2 - /usr/local/bin/yarn
      npm: 5.6.0 - ~/.nvm/versions/node/v9.11.2/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.4, X 10.11, macOS 10.13, tvOS 11.4, watchOS 4.3
    IDEs:
      Android Studio: 3.1 AI-173.4720617
      Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.4.1 => 16.4.1 
      react-native: 0.56.0 => 0.56.0 
    npmGlobalPackages:
      react-native-cli: 2.0.1

Description

When setting SKIP_BUNDLING before a clean build of a React Native application for an iOS device (not a simulator), the ip.txt file is not generated in the build directory, preventing the application from getting the packager host's IP address in guessPackagerHost.

This only affects projects whose build directories have been cleaned; if the project has been built before when SKIP_BUNDLING is not set, ip.txt is generated and remains there even after SKIP_BUNDLING is later set.

Reproducible Demo

These steps describe building from Xcode, but a previous version of this issue describes reproducible steps using react-native run-ios. I built from Xcode to demonstrate in the Xcode debugger that a value is nil when it should not be.

  1. rimraf ~/Library/Developer/Xcode/DerivedData

  2. react-native init NewProject1

  3. open NewProject1/ios/NewProject1.xcodeproj

  4. Add export SKIP_BUNDLING=1 to the build phase Bundle React Native code and images screen shot 2018-08-06 at 8 40 08 pm

  5. Build and run the application on an iOS device

Expected behavior

Application generates a jsCodeLocation that includes packager host's IP address. i.e. http://192.168.0.19:8081/index.bundle?platform=ios&dev=true&minify=false
Application loads JS bundle from packager

Actual behavior

Application fails to load React Native view, with error No bundle URL present. Make sure you're running a packager server or...
screen shot 2018-08-06 at 8 52 41 pm
img_20180806_205309

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions