Skip to content

Packager does not gracefully handle project switches #15963

@samuela

Description

@samuela

Is this a bug report?

Yes.

Have you read the Contributing Guidelines?

Yes.

Environment

  1. react-native -v:
    react-native-cli: 2.0.1
    react-native: 0.48.3
  2. node -v: v8.5.0
  3. npm -v: 5.3.0
  4. yarn --version: 0.17.2

Then, specify:

  • Target Platform: iOS
  • Development Operating System: macOS 10.12.6
  • Build tools: Xcode

Steps to Reproduce

The react native packager fails to detect a project switch and respond to it in a friendly way to the user.

Round 1:

  1. Create a react native project A which includes some JavaScript error that will be triggered on launch. Anything that produces the red screen of death should work.
  2. Run project A in the simulator with eg react-native run-ios.
  3. Keep in the local react native packager open.
  4. Create a react native project B. Just using react-native init with no modifications is sufficient.
  5. Run project B in the simulator with eg react-native run-ios.
  6. At this point you should be prompted with the same red screen of death citing the JavaScript error in project A even though you ran project B.

Round 2:

  1. Now, go back to project A and fix the JavaScript code such that it runs fine.
  2. Return to project B and run it in the simulator. You should now be presented with the `Application ... has not been registered." error screen (attached). This is not a bad error, since it provides a hint that immediately identifies the issue.
    screen shot 2017-09-15 at 1 46 41 pm
  3. Now, reintroduce the error in project A and we're back to the same situation.

Expected Behavior

I would expect to either see project B run successfully or an error indicating that the packager was in a bad state.

Actual Behavior

The local packager ends up in a corrupted state and produces unexpected behavior in the simulator.

Reproducible Demo

Hopefully the steps above are sufficient to repro the issue. If you have any issues, don't hesitate to reach out in the comments.

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