#Bug writing and creating a file with writeTextFile

4 messages · Page 1 of 1 (latest)

normal bay
#

Hello, I can't create / write to a file with Tauri 2 (it worked for Tauri 1) with writeTextFile :

Uncaught (in promise) invalid args pathfor commandwrite_text_file: command write_text_file expected a value for key path but the IPC call used a bytes payload

I add new permission :

  {
    "identifier": "fs:allow-write-text-file",
    "allow": [{ "path": "$APPDATA/**/*" }]
  },

Test with :

import { writeTextFile, BaseDirectory } from '@tauri-apps/plugin-fs';
const contents = JSON.stringify({ notifications: true });
await writeTextFile('config.json', contents, {
  baseDir: BaseDirectory.AppData,
  append: true 
});

Thanks

normal bay