Skip to content

No bundle url present: when the React Packager tab is closed #14118

Closed
@ecbrodie

Description

@ecbrodie

Description

This issue is spun off from #12754, to log a specific situation to create the "No bundle url present" error. I am running into the error message "No bundle URL present" in the iOS emulator when react-native run-ios is executed a subsequent time after a first successful execution. Specifically, once I close the terminal tab/window that spun off a React Packager process, I will run into this error.

I'm sure this screenshot is familiar from other React-Native issues, but here it is again:
screen shot 2017-05-22 at 11 26 29 pm

Reproduction Steps and Sample Code

From a brand new project (not built)

  1. Run react-native run-ios
  2. Observe that a tab for React Packager is spun off. As a part of it execution, the following line will appear in output:

Bundling index.ios.js ... done

  1. Observe that the iOS emulator is able to run the project successfully
  2. Close both the emulator and the tab for React Packager
  3. Run react-native run-ios again
  4. Observe that both the React Packager tab and the emulator will open. However, the "Bundling index.ios.js" will not appear and the error screen in the emulator will occur.

From a project already built

  1. Run react-native run-ios
  2. Similar to the last step above, the error in the emulator will occur. Also, the "Bundling index.ios.js" will not appear in the React Packager tab. So basically in this situation, we get to the error even faster than before.

Solution

The following workarounds exist, although each of them has their own reason why they are undesirable workarounds:

  • Remove the built iOS code via rm -rf ios/build. However, this defeats the purpose of the code-reloading that React Packager offers, since I would have to wait for a full rebuild every time I want to test out new changes.
  • Keep the React Packager tab always open. However, I find it unreasonable to enforce this requirement on development environments (for example, developers would not be able to turn off their computers, or else this bug would occur again after the computer restarts).
  • Immediately run react-native run-ios again. But there seems to be redundancy, slowness and sloppiness in this solution, having to run a command a second time just to avoid an error.

Additional Information

  • React Native version:
    $ react-native --version
    react-native-cli: 2.0.1
    react-native: 0.44.0
    
  • Platform: iOS
  • Development Operating System: MacOS 10.12.4
  • Dev tools: Xcode, using the iOS 9.3 simulator

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions