Create-react-app: Opens Chrome stable if Chrome Canary is running

Created on 8 Dec 2016  路  5Comments  路  Source: facebook/create-react-app

Description

npm start opens wrong browser. I have both Chrome and Chrome Canary on my system, but I only use Canary (which is set as my default browser system-wide).

Expected behavior

npm start should open my default browser.

Actual behavior

Ignores my default browser setting, and opens Chrome (stable).

Reproducible Demo

  1. Start Google Chrome Canary.app
  2. run npm start

Cause of the bug

node_modules/react-dev-utils/openBrowser.js:

execSync('ps cax | grep "Google Chrome"');

grep incorrectly matches "Google Chrome Canary". Probably the same error would happen with Beta.

execSync('ps cax | grep "Google Chrome$"');

seems to fix the problem (tested on OS X 10.11). Alternatively, pgrep -x "Google Chrome" may give more precise result.

bug

Most helpful comment

Yes, changing "Google Chrome" to "Chrome" in the applescript makes Canary reload the page as expected.

All 5 comments

@n3tr Could this be a regression after https://github.com/facebookincubator/create-react-app/pull/1165? Can you check before and after?

created PR #1215

@pornel Can you help me verify by change "Google Chrome" to "Chrome" in node_modules/react-dev-utils/openChrome.applescript line 17 and 61, does it work as expected?

Yes, changing "Google Chrome" to "Chrome" in the applescript makes Canary reload the page as expected.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Aranir picture Aranir  路  3Comments

JimmyLv picture JimmyLv  路  3Comments

rdamian3 picture rdamian3  路  3Comments

oltsa picture oltsa  路  3Comments

stopachka picture stopachka  路  3Comments