Skip to content

Commit 45ccef2

Browse files
AkaraChenfz6m
andauthored
feat: show message when have no network connection (#10153)
* feat: show message when have no network connection * feat: show message when have no network connection #10153 Co-authored-by: 咲奈Sakina <59400654+fz6m@users.noreply.github.com> Co-authored-by: 咲奈Sakina <59400654+fz6m@users.noreply.github.com>
1 parent 47dedc1 commit 45ccef2

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

packages/utils/src/getDevBanner.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ export function getDevBanner(
2525
const local = ` ${chalk.gray('>')} Local: ${chalk.green(
2626
`${protocol}//${host === '0.0.0.0' ? 'localhost' : host}:${port}`,
2727
)} `;
28-
const network = ` ${chalk.gray('>')} Network: ${chalk.green(
29-
`${protocol}//${address.ip()}:${port}`,
30-
)} `;
28+
const ip = address.ip();
29+
const network = ` ${chalk.gray('>')} Network: ${
30+
ip ? chalk.green(`${protocol}//${ip}:${port}`) : chalk.gray('Not available')
31+
} `;
3132
const maxLen = Math.max(
3233
...[header, footer, local, network].map((x) => stripAnsi(x).length),
3334
);

0 commit comments

Comments
 (0)