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();