From 0bd593baa777606ffb72f63eab9f5fd491062007 Mon Sep 17 00:00:00 2001 From: Sandro Padin Date: Fri, 28 Oct 2016 05:45:50 -0700 Subject: [PATCH] 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. --- packages/react-dev-utils/openBrowser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-dev-utils/openBrowser.js b/packages/react-dev-utils/openBrowser.js index 76b33a5924a..bee85a7d299 100644 --- a/packages/react-dev-utils/openBrowser.js +++ b/packages/react-dev-utils/openBrowser.js @@ -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;