vscode-react-native icon indicating copy to clipboard operation
vscode-react-native copied to clipboard

React Native packager still running in the background when debugger exists

Open jpokrzyk opened this issue 9 years ago • 7 comments

  • 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.

jpokrzyk avatar Mar 01 '17 20:03 jpokrzyk

@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.

vladimir-kotikov avatar Mar 02 '17 12:03 vladimir-kotikov

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 avatar Mar 02 '17 15:03 jpokrzyk

@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 avatar Oct 04 '17 02:10 ilhamahp

@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 avatar Oct 05 '17 08:10 vladimir-kotikov

@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 run react-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 avatar Oct 05 '17 09:10 ilhamahp

@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

vladimir-kotikov avatar Oct 05 '17 10:10 vladimir-kotikov

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

itoys avatar Oct 05 '17 12:10 itoys