You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Quitting react dev server closes browser and any open tabs #3113
I did notice this issue a couple months ago. The problem is that spawning the browser child process is handled by the opn module, which is very useful to abstract little details of different operative systems, but does not expose much options to detach the child process from the original process.
npm ls react-scripts (if you haven’t ejected): react-scripts@1.0.11
Operating system: macOS Sierra
Browser and version (if relevant): Chrome Version 63.0.3215.0
EDIT: I've since tried this on Arch Linux with Chromium 61.0.3163.79, node 8.5.0, npm 5.3.0, & react-scripts@1.0.13 and can confirm this behaviour (have also confirmed on opn repo) 👍
Thanks @W1lkins for confirming the issue in the opn repo. The PR with the fix has been merged, so let's wait until they make a release and update the opn version in react-scripts.
Unfortunately it happens for me too. I've gone from react-scripts 2.0.3 to react-scripts 2.0.5 without improvement. I'm using npm v5.6.0 and yarn v1.10.1 and project based on CRA 2.
This is a bear as I have a yarn linked copy of martial-ui in which I'm trying to debug Android weirdness in components and a build of material-ui hiccups the dev server. So I have to restart the dev server and all my Chrome remote debugging setup for mobile goes away :-|
FWIW if you add wait: false to the opn options in startBrowserProcess, opn will detach the child process so it's not linked to the react scripts process.
Activity
Timer commentedon Sep 12, 2017
That's not desirable!
If possible, could you look into this and fix the spawning of the process so it's not killed when its parent dies?
GAumala commentedon Sep 13, 2017
I did notice this issue a couple months ago. The problem is that spawning the browser child process is handled by the opn module, which is very useful to abstract little details of different operative systems, but does not expose much options to detach the child process from the original process.
I tried sending a pull request with a possible solution, but I didn't got a response in time so I moved on to different matters.
evalexpr commentedon Sep 14, 2017
This doesn't seem to happen for me:
node -v: v8.5.0npm -v:5.4.1yarn --version(if you use Yarn): 1.0.1npm ls react-scripts(if you haven’t ejected): react-scripts@1.0.11Operating system: macOS Sierra
Browser and version (if relevant): Chrome Version 63.0.3215.0
EDIT: I've since tried this on Arch Linux with
Chromium 61.0.3163.79,node 8.5.0,npm 5.3.0, &react-scripts@1.0.13and can confirm this behaviour (have also confirmed onopnrepo) 👍GAumala commentedon Sep 14, 2017
Thanks @W1lkins for confirming the issue in the
opnrepo. The PR with the fix has been merged, so let's wait until they make a release and update theopnversion inreact-scripts.chrifox commentedon Oct 3, 2017
Hi I am having this same issue on Ubuntu 16.10 running node v6.11.1, is there a workaround until a fix is released?
GAumala commentedon Oct 3, 2017
I think the easiest workaround is to have your browser up and running well before starting the dev server.
If the browser is an independent process, it won't be closed when the dev server is interrupted.
gaearon commentedon Jan 14, 2018
I bumped
opnto the latest which includes your fix so this should be solved in the next release.#3784
gaearon commentedon Jan 15, 2018
The fix is out in
react-scripts@1.1.0! Please let us know if something doesn’t quite work.https://github.com/facebookincubator/create-react-app/releases/tag/v1.1.0
kish0x commentedon Jun 23, 2018
this issue occurring again. I'm using
react-scripts@1.1.4acammies commentedon Sep 12, 2018
Happening for me too, using
react-scripts@1.1.4on Fedora 28 in a Virtual Box on windows.Also using
npm v5.6.0 and node v8.11.4timburgess commentedon Oct 23, 2018
Unfortunately it happens for me too. I've gone from
react-scripts 2.0.3toreact-scripts 2.0.5without improvement. I'm usingnpm v5.6.0andyarn v1.10.1and project based on CRA 2.This is a bear as I have a
yarn linked copy of martial-ui in which I'm trying to debug Android weirdness in components and a build of material-ui hiccups the dev server. So I have to restart the dev server and all my Chrome remote debugging setup for mobile goes away :-|On
Ubuntu 18.04kitwestneat commentedon Nov 13, 2018
FWIW if you add wait: false to the opn options in startBrowserProcess, opn will detach the child process so it's not linked to the react scripts process.
sreetamdas commentedon Nov 14, 2018
Still being affected by this, is there a workaround to this?
tomByrer commentedon Feb 26, 2019
I do not see this in Win10, Firefox, & bash in VSCode.