-
-
Notifications
You must be signed in to change notification settings - Fork 27k
npm start
variable BROWSER
is not working.
#11873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I also did a much research on this issue but couldn't find a working solution. The snippet below is not a proper solution but achieved my requirement and might be helpful for you.
|
Known issues: 1. `npm start` variable `BROWSER` is not working: facebook/create-react-app#11873 2. `[DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Ple ase use the 'setupMiddlewares' option.`: facebook/create-react-app#12035
Known issues: 1. `npm start` variable `BROWSER` is not working: facebook/create-react-app#11873 2. `[DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Ple ase use the 'setupMiddlewares' option.`: facebook/create-react-app#12035
I tried setting the BROWSER envrionment variable on command line, in .env file, in package.json as well as exporting from my .bashrc (on Ubuntu), but it does not work with react-scripts 5.0.1. When I reverted back to 4.0.1, it worked. So something is still broken in 5.0.1. |
IF YOU ARE USING ANGULAR:
Remove the '--open' |
This issue is still happening. |
bump |
Yup, I am having the same issue too in WSL 2 Ubuntu |
I can confirm, I still have this issue in WSL on Win 11. I tried having "BROWSER=chrome" in the scripts but that didn't help. Edit : Looks like my issue was different. I found the solution to my problem. I was running my project in the Windows file system (root/mnt/d/... here d is my local windows drive) from WSL, I moved my project to the Linux file system (root/home/..) and viola it started working fine. |
Seeing this issue as well in CRA 5. But works in v4. On MacOS with Safari as default browser. Although if Chrome is already open, then CRA will use Chrome instead. |
This issue is still happening. I use Firefox as my default daily web browser and Chrome for development. workaround steps:
|
For anyone it may help, my recommendation is to move to Vite or RSBuild. We migrated a large CRA app to RSBuild. |
package.json
It works in CRA v4.x.
But it doesn't work in CRA v5.0.0
It opens with the default browser (Firefox).
Environment
Windows 10
WSL 2
node v14.16.0
npm v6.14.11
The text was updated successfully, but these errors were encountered: