Vscode-react-native: React Native packager still running in the background when debugger exists

Created on 1 Mar 2017  路  7Comments  路  Source: microsoft/vscode-react-native

  • VSCode Version: Code 1.9.1 (f9d0c687ff2ea7aabd85fb9a43129117c0ecf519, 2017-02-08T23:31:51.320Z)
  • OS Version: Darwin x64 16.5.0
  • Extensions:

|Extension|Author|Version|
|---|---|---|
|vscode-markdownlint|DavidAnson|0.6.2|
|beautify|HookyQR|0.8.8|
|alignment|annsk|0.3.0|
|npm-intellisense|christian-kohler|1.3.0|
|path-intellisense|christian-kohler|1.2.0|
|prettier-vscode|esbenp|0.9.0|
|git-project-manager|felipecaputo|1.0.1|
|auto-close-tag|formulahendry|0.3.9|
|auto-rename-tag|formulahendry|0.0.11|
|debugger-for-chrome|msjsdiag|2.5.5|
|vscode-react-native|vsmobile|0.3.1|


When I debug a react native application in vs code the webpack packager is still running in the background even though I stop debugging. I have to completely quit the VS code window to kill it.

Steps to Reproduce:

  1. Create a react native project
  2. Debug ios react native app with the following launch config
  3. Stop the vs code react native debugger by hitting the red box stop button
  4. Keep the window open
  5. Run react-native run-ios from a terminal. Normally this would spawn another terminal. But in this case it won't because the webpack packager is running hidden in vs code.

Not a huge deal. Just thought I would mention it. Thanks.

Most helpful comment

@jpokrzyk, I think this is expected behavior. IMO this was done to reduce time requred to restart or launch another debug session. @MSLaguana might know more about this.

As for stopping packager, I think that quitting VSCode is not necessary for this - you can use React Native: Stop packager command, available in command pallete - just press F1 and start typing stoppa... to find it.

All 7 comments

@jpokrzyk, I think this is expected behavior. IMO this was done to reduce time requred to restart or launch another debug session. @MSLaguana might know more about this.

As for stopping packager, I think that quitting VSCode is not necessary for this - you can use React Native: Stop packager command, available in command pallete - just press F1 and start typing stoppa... to find it.

Ah nice. Yea that makes sense.

I still think the packager should top when the user hits the stop button on the debugger (and then maybe don't stop the packer when the user hits the debugger restart button).

But now that I know the command to stop the packager, that's all I really wanted. Thanks for working on this, debugging RN in VS Code is a great experience!

@jpokrzyk I feel the same way ,,, it is so annoying when you stop it but the packager still running in background. I have to kill it on by one ,since there are so many of them ,,, sigh

@ilhamahp can you explain your use case? Why would you want to stop packager every time when debugging stops?

I think that the idea of react-native packager is to run it once and then keep it running all the time since it has live-reload capabilities and can handle changed sources and rebuild bundle on-the-fly, so restarting it every time is just redundant.

@vladimir-kotikov In my case , I made several projects continuously. The purpose is testing the effect from different package's versions for my task. I used to use RN in windows. Everytime I runreact-native run-android or react-native start, it will pop up a new window foe Node,js for processing the packager. It works the same way in mac. Then, linux behave differently. instead pop up a new windows, it runs in background. So when I make another project, I have to kill node process

@ilhamahp, that makes sense.

In your case it would be reasonable to have packagers for different projects bound to different ports so they are not interfere with each other. Though this is not yet supported (at least in latest released version) we've done some improvements to support this use case

/cc @iTOYS

Yep, we've added support for port customizing here #536
Will be available in new release.

Was this page helpful?
0 / 5 - 0 ratings