From 9f1560e308c873a0efe87c85a3a838b881fb0508 Mon Sep 17 00:00:00 2001 From: Sandro Padin Date: Tue, 25 Oct 2016 11:35:27 -0700 Subject: [PATCH] Catch and noop call to open web browser. 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;