I just started a project with react-create-app template typescript.
When I do npm run dev it opens edge browser, I was expecting chrome.
Any idea how to make it open in chrome?
I just started a project with react-create-app template typescript.
When I do npm run dev it opens edge browser, I was expecting chrome.
Any idea how to make it open in chrome?
From Create React App documentation
By default, Create React App will open the default system browser, favoring Chrome on macOS. Specify a browser to override this behavior, or set it to none to disable it completely. If you need to customize the way the browser is launched, you can specify a node script instead. Any arguments passed to npm start will also be passed to this script, and the url where your app is served will be the last argument. Your script's file name must have the .js extension.
Easy answer is to change your default browser. However if you want to keep your default browser to Edge you can do this.
BROWSER=chrome npm start
BROWSER=chrome npm run dev
Consider that browser names are different. For example, Chrome is google chrome on macOS, google-chrome on Linux and chrome on Windows.
Linux
"start": "BROWSER='google-chrome-stable' react-scripts start"
Windows
"start": "BROWSER='chrome' react-scripts start"
Mac
"start": "BROWSER='google chrome' react-scripts start"
This question might probably gives the answer: create-react-app: How do I "npm start" with a specific browser?
In short: "By default, Create React App will open the default system browser, favoring Chrome on macOS." from the documentation. My guess is that your default browser is set to Edge, and if you set it to Chrome, it will open it in Chrome instead.
To solve this, I need to give a default setting in vscode. It was empty, so I fill in chrome.