tauri dev is one of those things you stop thinking about. You save a Rust file, it rebuilds, the app comes back. So when it quietly stops rebuilding, it takes a while to even notice.
That's what issue #9163 was about. It had been open since March 2024. The reporter wanted tauri dev to watch only a few things, so they wrote their .taurignore as an allow list. Trimmed a little (their file also kept icons/), it looked like this:
/* !/*.toml !/*.rs !/src Ignore everything at the top, then bring back the .toml files, the .rs files and src/. Same file as a .gitignore? Works fine. As a .taurignore? tauri dev stopped watching the app completely. Edit src/main.rs, nothing happens.
I picked it up, and the fix got merged in tauri-apps/tauri#16398. The fix that got merged is not the one I sent first, though, and that part is honestly the most useful bit of this story.
Reproducing it
Tauri's repo has a tiny app in bench/tests/helloworld. I dropped the .taurignore into its src-tauri folder and ran tauri dev. The CLI prints every folder it's watching, and the app folder just wasn't in the list.
Why it happened
The dev watcher lives in crates/tauri-cli/src/interface/rust.rs. Before my change it did roughly this:
for path in watch_folders { if !ignore_matcher.is_ignore(&path, true) { // watch every entry of `path` } } So before watching a folder, it asked the ignore matcher: is this folder itself ignored? For the app folder, that's the same folder the .taurignore sits in.
The matcher comes from the ignore crate (the one ripgrep uses). Patterns in an ignore file are relative to the file's own folder, so the crate strips that folder off the path before matching. Ask it about the folder itself and you're left with an empty path. And /* matches the empty path too.
So the app folder counted as ignored and got skipped. The !/src lines never had a chance, because they bring back things inside the folder, and the watcher never looked inside.
Git doesn't have this problem because it never applies a .gitignore to the folder the file lives in. Only to what's below it. That one difference was the whole bug.
My first fix
Since git was the behaviour everyone expected, I copied it. In IgnoreMatcher::is_ignore, skip an ignore file when the path you're asking about is that file's own folder. Everything inside the app matched exactly like before, and a .taurignore in a parent folder could still ignore a child folder.
I wrote the test first, using the .taurignore above, and watched it fail on the old code. Then the fix, and the test passed. tauri dev on the bench app showed the app folder in the "Watching … for changes" log again. Then I opened the PR.
The review
Legend-Master from the Tauri team requested changes. His point was that negative patterns are tricky to support, and treating /* at the root as a special case didn't really make sense. Then he asked whether we should just always watch the folders and filter the change events instead.
He was right, and when I thought about it, it was a better way to see the problem. My fix answered "is this folder ignored?" more carefully. His idea was to stop asking that question about the watch folders at all. A watch folder is something you told Tauri to watch. The ignore rules are about what's in it.
The fix that got merged
I reworked the PR around that. A new helper, watch_targets, lists what to watch: every entry of every watch folder that isn't ignored.
fn watch_targets(watch_folders: &[PathBuf]) -> Vec<(PathBuf, RecursiveMode)> { let mut targets = Vec::new(); for path in watch_folders { lookup(path, |file_type, p| { if p != *path { let mode = if file_type.is_dir() { RecursiveMode::Recursive } else { RecursiveMode::NonRecursive }; targets.push((p, mode)); } }); } targets } lookup already existed. It walks one level of the folder with the ignore crate's WalkBuilder, set up to read .taurignore (plus the watcher rules Tauri ships with), so ignored entries never come back from it. The walk also hands back the folder itself, which is what the p != *path check skips.
The watch loop then stops asking about the folder:
// logging lines left out for (path, mode) in watch_targets(&watch_folders) { let _ = watcher.watch(&path, mode); } Change events are still filtered by IgnoreMatcher::is_ignore, same as before, so touching an ignored file doesn't trigger a rebuild.
Two tests cover it, both with the .taurignore from the issue. The first, watch_targets_watch_a_folder_whose_taurignore_matches_it, checks that the watched entries are exactly Cargo.toml and src. The second, ignore_matcher_filters_events_under_a_root_wide_pattern, checks that the matcher the event loop uses keeps src/, src/main.rs and Cargo.toml, and ignores README.md and assets/.
And the real check: with that file, editing README.md triggers no rebuild, and editing src/main.rs triggers one.
Legend-Master approved it. He mentioned that from his experience with parcel's watcher (the one VS Code uses), it seemed to watch the whole folder and match ignore patterns before events reach the app, and this change basically matches that. FabianLars approved too. It was merged on 12 November 2026 and shipped in tauri-cli and @tauri-apps/cli 2.12.5.
What I'm keeping from this one
The reporter's file was the best test fixture I could have asked for. I barely changed it.
When something works as a .gitignore and not as your file, ask what git does differently. That question is what pointed me at the root folder.
And the big one for me: my first fix passed its tests, but it added a special case. The maintainer's version deleted the question that caused the bug, and the code got simpler. I'll take that trade every time.
Thanks Legend-Master and FabianLars for the reviews. If you've hit this before, or you do file watching differently in your project, I'd really like to hear how. Drop a comment.
