this React code
import { message } from "@tauri-apps/plugin-dialog";
import { writeText } from "@tauri-apps/plugin-clipboard-manager";
async function copy() {
try {
await writeText(text);
await message("Text copied to clipboard!", {
title: "Success",
kind: "info",
});
} catch (e) {
await message(`Error: ${e instanceof Error ? e.message : String(e)}`, {
title: "Error",
kind: "error",
});
}
}
returns message:
Error: clipboard-manager.write_text not allowed. Permissions associated with this command: clipboard-manager:allow-write-text
How to fix this?
James Z
12.3k10 gold badges28 silver badges50 bronze badges
-
It appears you need to ask for permission from the user to copy to the clipboard v2.tauri.app/plugin/clipboard/#default-permissionFélix Adriyel Gagnon-Grenier– Félix Adriyel Gagnon-Grenier2025年07月27日 06:45:34 +00:00Commented Jul 27, 2025 at 6:45
-
v2.tauri.app/learn/security/using-plugin-permissionsFélix Adriyel Gagnon-Grenier– Félix Adriyel Gagnon-Grenier2025年07月27日 06:53:10 +00:00Commented Jul 27, 2025 at 6:53
default