Skip to content

Commit

Permalink
Catch and noop call to open web browser. (#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 gaearon committed Oct 28, 2016
1 parent 91c8650 commit 0bd593b
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 0bd593b

Please sign in to comment.