trunk-rs/trunk

trunk serve --open opens the page anyways on error

Open

#946 opened on Feb 15, 2025

 (2 comments) (0 reactions) (0 assignees)Rust (315 forks)auto 404
good first issuehelp wanted

Repository metrics

Stars
 (4,347 stars)
PR merge metrics
 (PR metrics pending)

Description

In case of address already in use for example:

╰─ trunk serve --open
2025-02-15T02:48:23.064899Z  INFO 🚀 Starting trunk 0.21.7
2025-02-15T02:48:23.926930Z  INFO 📦 starting build
   Compiling proc-macro2 v1.0.86
   ....
   Compiling todomvc v0.1.0 (/home/maa/Projects/yew/examples/todomvc)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 17.52s
2025-02-15T02:48:42.232224Z  INFO applying new distribution
2025-02-15T02:48:42.232419Z  INFO ✅ success
2025-02-15T02:48:42.232495Z  INFO 📡 serving static assets at -> /
2025-02-15T02:48:42.232645Z  INFO 📡 server listening at:
2025-02-15T02:48:42.232652Z  INFO     🏠 http://127.0.0.1:8080/
2025-02-15T02:48:42.232655Z  INFO     🏠 http://[::1]:8080/
2025-02-15T02:48:42.232835Z  INFO     🏠 http://localhost.:8080/
2025-02-15T02:48:42.245691Z ERROR error from server task error=Address already in use (os error 98)
2025-02-15T02:48:42.245730Z ERROR Address already in use (os error 98)

It exits with non-zero exit code and opens http://127.0.0.1:8080/ in the browser anyways

Contributor guide