From cdcfc03f802f5ca3a2a7dc95737a8a596f28d48e Mon Sep 17 00:00:00 2001 From: J3vb <192430104+J3vb@users.noreply.github.com> Date: Sun, 2 Aug 2026 09:32:20 +0200 Subject: [PATCH] fix(client): stop vite watching src-tauri MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `npm run tauri dev` died on Windows partway through the cargo build: Error: EBUSY: resource busy or locked, watch 'src-tauri\target\debug\deps\owncord_client_lib.dll' Error The "beforeDevCommand" terminated with a non-zero status code. Vite's watcher recursed into `src-tauri/target/`, and the moment cargo wrote the output DLL, node's FSWatcher raised EBUSY as an unhandled error event and killed the vite process. Vite is tauri's `beforeDevCommand`, so its death aborted the whole dev session. The config matched the upstream Tauri vite template in every respect except the `server.watch.ignored` block that template ships with. Add it. Tauri already watches `src-tauri` itself for rebuilds, so nothing is lost. Windows-specific — EBUSY on an open handle is a Windows filesystem semantic, and CI only ever runs `tauri build`, never `tauri dev`, so neither caught it. Co-Authored-By: Claude Opus 5 (1M context) --- Client/tauri-client/vite.config.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Client/tauri-client/vite.config.ts b/Client/tauri-client/vite.config.ts index 81bf0676..4bc11bbd 100644 --- a/Client/tauri-client/vite.config.ts +++ b/Client/tauri-client/vite.config.ts @@ -42,5 +42,13 @@ export default defineConfig({ strictPort: true, host: host || false, hmr: host ? { protocol: "ws", host, port: 1421 } : undefined, + watch: { + // Never watch the Rust tree. `tauri dev` runs Vite as its + // `beforeDevCommand`, so without this the watcher picks up + // `src-tauri/target/` and dies with EBUSY the moment cargo writes the + // output DLL on Windows — taking the whole dev session with it. Tauri + // already watches `src-tauri` itself for rebuilds. + ignored: ["**/src-tauri/**"], + }, }, });