From 25e920e169db900ca4f07c2bb9eb290e9f9f2c7d Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Tue, 14 Oct 2025 07:28:18 -0300 Subject: [PATCH] fix(cli): wait for dev command to exit with --no-watch, closes #14284 (#14298) --- .changes/fix-no-watch-dev-server-kill.md | 6 ++++++ crates/tauri-cli/src/interface/rust.rs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changes/fix-no-watch-dev-server-kill.md diff --git a/.changes/fix-no-watch-dev-server-kill.md b/.changes/fix-no-watch-dev-server-kill.md new file mode 100644 index 000000000..f9bb0d0be --- /dev/null +++ b/.changes/fix-no-watch-dev-server-kill.md @@ -0,0 +1,6 @@ +--- +"tauri-cli": patch:bug +"@tauri-apps/cli": patch:bug +--- + +Wait for dev server to exit before exiting the CLI when the app is closed on `tauri dev --no-watch`. diff --git a/crates/tauri-cli/src/interface/rust.rs b/crates/tauri-cli/src/interface/rust.rs index c52c4f508..067dd5ca3 100644 --- a/crates/tauri-cli/src/interface/rust.rs +++ b/crates/tauri-cli/src/interface/rust.rs @@ -215,8 +215,8 @@ impl Interface for Rust { if options.no_watch { let (tx, rx) = sync_channel(1); self.run_dev(options, run_args, move |status, reason| { + on_exit(status, reason); tx.send(()).unwrap(); - on_exit(status, reason) })?; rx.recv().unwrap();