question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add flag to react-scripts to suppress auto-opening `localhost:3000`

See original GitHub issue

Auto-opening the browser tab can get really annoying in certain situations.

  • Sometimes I already have the window open and would prefer to just reload the tab.

  • Other times I’m testing another browser and don’t want to keep opening my default browser.

  • Sometimes I need to open a custom URL. In my latest project, I need to add a query string to use the staging server instead of the production server. With the suppression flag, I could change my start script to: react-scripts start --no-open-browser; open localhost:3000?useapi=production

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

19reactions
Timercommented, May 5, 2017

You can run BROWSER=none npm start or create an .env file with BROWSER=none in it to prevent the browser from opening.

Let us know if you need help with anything else!

1reaction
Timercommented, May 5, 2017

Yeah, our tab reloading only works for Chrome (sorry!). If you’re familiar with AppleScript, you can try to contribute Firefox support!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How stop after running react-scripts start? - Stack Overflow
Hit your keyboard shortcut for stopping terminal commands (usually Ctrl+C or Ctrl+Q). Or, if you don't have input access to the process, ...
Read more >
Everything you need to know about react-scripts
ceate-react-app comes with useful scripts that eliminate the slog of configuration, making it easier than ever to build React apps.
Read more >
Advanced Configuration - Create React App
Variable Development Production BROWSER ✓ Used 🚫 Ignored BROWSER_ARGS ✓ Used 🚫 Ignored HOST ✓ Used 🚫 Ignored
Read more >
How To Set Up a React Project with Create React App
http://localhost:3000 Note that the development build is not optimized. To create a production build, use npm run build. If you are running the ......
Read more >
How to get create-react-app to work with a Node.js back-end API
Create a /client directory under example-create-react-app-express ... Open ./package.json and add the following to the scripts entry
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found