From c33389fbd4dab8bd62e55ad2b7e53cb8b4f8247c Mon Sep 17 00:00:00 2001 From: Yawei Xue <153379052@qq.com> Date: Thu, 2 Nov 2023 15:30:35 +0800 Subject: [PATCH] CLI Bug: open browser in CLI block start process f user default browser is Chrome or Chromium, then cli will use better-opn to open browser, but this command may facing error and not been captured, then it will block the whole start process. Solution: add await to betterOpn in order to catch error in betterOpn, otherwise it will be a unhandled promise error. --- code/lib/core-server/src/utils/open-in-browser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/core-server/src/utils/open-in-browser.ts b/code/lib/core-server/src/utils/open-in-browser.ts index f7e7be3d5a70..ef798cd5242f 100644 --- a/code/lib/core-server/src/utils/open-in-browser.ts +++ b/code/lib/core-server/src/utils/open-in-browser.ts @@ -25,7 +25,7 @@ export function openInBrowser(address: string) { ) { // We use betterOpn for Chrome because it is better at handling which chrome tab // or window the preview loads in. - betterOpn(address); + await betterOpn(address); } else { await open(address, openOptions); }