#"path not allowed on the configured scope"

6 messages · Page 1 of 1 (latest)

golden dragon
#

Here's my tauri.conf.json

{
  "build": {
    "beforeDevCommand": "npm run dev",
    "beforeBuildCommand": "npm run build",
    "devPath": "http://localhost:1420",
    "distDir": "../dist"
  },
  "package": {
    "productName": "Intentio",
    "version": "1.1.0"
  },
  "tauri": {
    "allowlist": {
      "protocol": {
        "asset": true,
        "assetScope": [
          "$RESOURCE/*",
          "$APPDATA/*"
        ]
      },
      "all": true,
      "fs": {
        "all": false,
        "readFile": true,
        "writeFile": true,
        "readDir": true,
        "copyFile": true,
        "createDir": true,
        "scope": [
          "$APP/*",
          "$APP",
          "$RESOURCE",
          "$RESOURCE/*"
        ]
      }
    },
    "bundle": {
      "active": true,
      "category": "DeveloperTool",
      "copyright": "",
      "deb": {
        "depends": []
      },
      "externalBin": [],
      "icon": [
        "icons/32x32.png",
        "icons/128x128.png",
        "icons/[email protected]",
        "icons/icon.icns",
        "icons/icon.ico"
      ],
      "identifier": "intentio.app",
      "longDescription": "A pomodoro timer.",
      "macOS": {
        "entitlements": null,
        "exceptionDomain": "",
        "frameworks": [],
        "providerShortName": null,
        "signingIdentity": null
      },
      "resources": [
        "./assets/audio/*"
      ],
      "shortDescription": "A pomodoro timer.",
      "targets": "all",
      "windows": {
        "certificateThumbprint": null,
        "digestAlgorithm": "sha256",
        "timestampUrl": ""
      }
    },
...
  }
}
#

Here's my code

// Reads files in audio directory matchings the specified file formats
  const readTracks = () => {
    readDir("assets/audio", {
      dir: BaseDirectory.Resource,
      recursive: false,
    }).then((entries) => {
      setTracks(
        entries.filter((entry) =>
          AUDIO_FORMATS.some((ending) => entry.path.endsWith(ending))
        )
      );
    });
  };
#

I need some help guys, can't figure this out

#

Also my tauri version is v1.2.3

#

I believe this very similar code used to work on some previous version of tauri

#

oh my god never mind just got it to work