Skip to content

Commit

Permalink
Catch and noop call to open web browser. (facebook#964)
Browse files Browse the repository at this point in the history
Running `create-react-app` in a Docker container causes an unhandled rejection error in nodejs > 6.5 because the `opn` module tries to open a web browser in a system that doesn't have one. I figured this error could be safely ignored.
  • Loading branch information
spadin authored and alexdriaguine committed Jan 23, 2017
1 parent 6126ac9 commit 930a7c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-dev-utils/openBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function openBrowser(url) {
// Fallback to opn
// (It will always open new tab)
try {
opn(url);
opn(url).catch(() => {}); // Prevent `unhandledRejection` error.
return true;
} catch (err) {
return false;
Expand Down

0 comments on commit 930a7c7

Please sign in to comment.