plugins-workspace icon indicating copy to clipboard operation
plugins-workspace copied to clipboard

fs:watch "Command watch not found"

Open mikefarquhar opened this issue 1 year ago • 2 comments

Hi, I'm trying out Tauri v2 for a personal project and can't seem to get the watch function from the fs plugin to work. I get the following error when trying to watch on a folder: Screenshot 2024-08-18 104835 At first I thought this may have been because I was running in WSL2, but the screenshot above is from a regular Windows env. If it's not a bug then it might be a permissions issue as I'll admit to finding the permissions requirements unclear. Currently they look like this:

[
    "core:default",
    "fs:default",
    "fs:scope-home-recursive",
    "fs:allow-home-read-recursive",
    "fs:allow-home-write-recursive",
    "fs:allow-home-meta-recursive",
    "fs:allow-watch",
    "fs:allow-unwatch",
    "dialog:default"
  ]

Any confirmation/help on this front would be greatly appreciated.

mikefarquhar avatar Aug 18 '24 09:08 mikefarquhar

Looks like it's not documented right now, but you also need to add the watch feature flag to the tauri-plugin-fs dependency in Cargo.toml, can you check that you have it?

If you do and it's still not working, please show the output of tauri info and additionally the js and rust versions of the fs plugin.

FabianLars avatar Aug 19 '24 12:08 FabianLars

That's it working, thank you so much! 😄

mikefarquhar avatar Aug 19 '24 17:08 mikefarquhar

This is documented in https://github.com/tauri-apps/tauri-docs/pull/2677, closing as completed

Legend-Master avatar Apr 10 '25 16:04 Legend-Master