Skip to content

Commit c967491

Browse files
spadinjarlef
authored andcommitted
Catch and noop call to open web browser. (facebook#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.
1 parent 78cd3d6 commit c967491

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: packages/react-dev-utils/openBrowser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function openBrowser(url) {
2828
// Fallback to opn
2929
// (It will always open new tab)
3030
try {
31-
opn(url);
31+
opn(url).catch(() => {}); // Prevent `unhandledRejection` error.
3232
return true;
3333
} catch (err) {
3434
return false;

0 commit comments

Comments
 (0)