Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript server doesn't terminate upon closing terminal #18015

Closed
ballenwillis opened this issue Feb 18, 2018 · 5 comments
Closed

JavaScript server doesn't terminate upon closing terminal #18015

ballenwillis opened this issue Feb 18, 2018 · 5 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@ballenwillis
Copy link

ballenwillis commented Feb 18, 2018

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: Linux 4.13 (Ubuntu 17.10)
Node: 8.9.4
Yarn: 1.3.2
npm: 5.6.0
Watchman: Not Found
Xcode: N/A
Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: 0.52.0 => 0.52.0

Target Platform: android:minSdkVersion="16"
android:targetSdkVersion="23"

Steps to Reproduce

(On a linux machine)

  1. run command "sudo lsof -i :8081" and kill any processes on that port with the command "kill -9 "
  2. react-native init test
  3. cd test
  4. react-native run-android
  5. close/stop terminal (either by closing out of the terminal or pressing ctrl+c; doesn't matter)
  6. run command "sudo lsof -i :8081".

Expected Behavior

There are no processes active on port 8081 and you can run "react-native run-android" any time in the future and it works.

Actual Behavior

The JS server is still running on port 8081. I do not understand why, but this creates a problem when running the app again. After starting the intent (usually the last thing in the terminal after running react-native run-andriod), it just stops automatically as seen in my terminal below:
react-native-run-android-abrupt-termination

Versus how I usually stop it as seen in my terminal below:
react-native-correct-termination

Reproducible Demo

https://github.com/BWillis98/test
I apologize that I know nothing about "snack", but I've uploaded the test repository I created when going through "Steps to reproduce". I don't think it's really necessary since all I did was run the command "react-native init test" and then push it to a github repository.

Workaround To Problem

Run the command "sudo lsof -i :8081", make note of the PID of the process where the column under "COMMAND" is titled "node", and then run the command "kill -9 [PID]" as demonstrated here:

workaround

However, I don't want to do this every time I want to load the app onto my phone and it took a lot of time to narrow down the issue to this and I'd like to save future developers the time of fixing this issue.

@ballenwillis
Copy link
Author

Any update?

@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?

I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.

How to ContributeWhat to Expect from Maintainers

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon. labels Feb 24, 2018
@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 24, 2018
@ballenwillis
Copy link
Author

Upgraded to react-native version 0.53.3 and the problem still persists.

@ballenwillis
Copy link
Author

Opened new issue

@kapil5harma
Copy link

Facing a similar problem, any updates?

@facebook facebook locked as resolved and limited conversation to collaborators Feb 24, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Feb 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants