fix(client): stop vite watching src-tauri

`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) <noreply@anthropic.com>
This commit is contained in:
J3vb
2026-08-04 17:43:13 +02:00
co-authored by Claude Opus 5
parent a308f81fb4
commit cdcfc03f80
+8
View File
@@ -42,5 +42,13 @@ export default defineConfig({
strictPort: true, strictPort: true,
host: host || false, host: host || false,
hmr: host ? { protocol: "ws", host, port: 1421 } : undefined, 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/**"],
},
}, },
}); });