Skip to content

Commit

Permalink
CLI Bug: open browser in CLI block start process
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
xueyawei authored Nov 2, 2023
1 parent e1cb740 commit c33389f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/lib/core-server/src/utils/open-in-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit c33389f

Please sign in to comment.