electron-with-create-react-app icon indicating copy to clipboard operation
electron-with-create-react-app copied to clipboard

Running last version of react-scripts will cause to launch the app in both Browser and Electron window

Open Calandal95 opened this issue 6 years ago • 3 comments

Hi, i was updating the app to the latest versions of the packages- Everything was fine until i updated the react-scripts package to the last version (2.1.3). Now running yarn dev will cause to launch the app in the browser and lately in the electron window. Any idea on how to fix it?

Calandal95 avatar Jan 10 '19 16:01 Calandal95

Unfortunately I don't know. I haven't had a chance to update versions of the package dependencies.

csepulv avatar Jan 11 '19 04:01 csepulv

I found a fix for this. In package.json under scripts change "start": "react-scripts start", to "start": "SET BROWSER=none&&react-scripts start", . That's what worked for me. Note that the lack of spacing is intentional. Reference from https://github.com/facebook/create-react-app/issues/873#issuecomment-396803278

dascoder avatar Feb 21 '19 22:02 dascoder

As per this comment, you can also create a .env file in the root of your project with BROWSER=none as the contents - this works perfectly and is a little bit nicer than setting the BROWSER variable in the start script! 😄

jamieweavis avatar Feb 25 '19 21:02 jamieweavis