fs watch functionality error on upgrade to Tauri v2 #10837
Answered
by
FabianLars
dmca-glasgow
asked this question in
Q&A
-
Hi there, I upgraded to tauri v2 today, and everything seems to be fine except for fs watch. With the following Typescript: import { watchImmediate } from '@tauri-apps/plugin-fs';
//...
destroyWatcher = await watchImmediate(newFilePath, (event) => {
console.log('hey!');
}); I get the error:
(And 'hey!' is not logged to the console) In {
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"windows": ["main"],
"permissions": [
"core:default",
"shell:allow-open",
"dialog:default",
"fs:default",
{
"identifier": "fs:read-files",
"allow": [{ "path": "**/*" }]
},
{
"identifier": "fs:allow-watch",
"allow": [{ "path": "**/*" }]
},
{
"identifier": "fs:allow-unwatch",
"allow": [{ "path": "**/*" }]
}
]
} Any ideas? Thanks. |
Beta Was this translation helpful? Give feedback.
Answered by
FabianLars
Sep 2, 2024
Replies: 1 comment 2 replies
-
I've created a minimal reproduction here: https://github.com/dmca-glasgow/tauri-fs-watch The 3 commits show the 3 steps to get to this error. Thanks. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's not properly documented right now but you need to change
to