Catch and noop call to open web browser. (#964)

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.
This commit is contained in:
Sandro Padin
2016-10-28 05:45:50 -07:00
committed by Dan Abramov
parent 91c86502a4
commit 0bd593baa7

View File

@@ -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;