Repository: tauri
Issue: [bug] fs-plugin exists() results in "Uncaught (in promise) forbidden path" when used with the path api
Labels: type: bug,status: needs triage

### Describe the bug

Calling `exists()` with a path results in "Uncaught (in promise) forbidden path". Using a baseDir does not result in this issue.

### Reproduction

Will check if the file `test/exists.json` exists.

Create the following file in src-tauri: `test/exists.json`

Bundle the file:
```
"resources": [
  "test/**/*"
]
```
Set the permissions in default.json (fs:allow-resource-read-recursive and fs:allow-resource-meta-recursive" was set as an attempted workaround):
```JSON
"permissions": [
  {
    "identifier": "fs:scope-resource",
    "allow": [
      {
        "path": "$RESOURCE"
      },
      {
        "path": "$RESOURCE/test/**"
      }
    ]
  },
  "core:default",
  "opener:default",
  "core:window:allow-hide",
  "core:window:allow-show",
  "core:window:allow-set-size",
  "fs:default",
  "fs:allow-resource-read-recursive",
  "fs:allow-resource-meta-recursive"
]
```
Try to see if the file exists in a Vue component:
```JS
async function loadFilesTest() {
    const resource_dir = await path.resourceDir()
    const exist_string = "test/exists.json"
    const does_not_exist_string = "test/does_not_exist.json"
    const exist_path = await path.join(resource_dir, exist_string)
    const does_not_exist_path = await path.join(resource_dir, does_not_exist_string)
    const file_exists_base = await exists(exist_string, {
        baseDir: BaseDirectory.Resource
    })
    const file_does_not_exist_base = await exists(does_not_exist_string, {
        baseDir: BaseDirectory.Resource
    })
    const file_exists_path = await exists(exist_path)
    // const file_does_not_exist_path = await exists(does_not_exist_path) //Uncaught (in promise) forbidden path:
    console.log(exist_path, "exists with base dir: ", file_exists_base)
    console.log(does_not_exist_path, "exists with base dir: ", file_does_not_exist_base)
    console.log(exist_path, "exists with path api: ", file_exists_path)
    // console.log(does_not_exist_path, "doesn't work with path api: ", file_does_not_exist_path)

}

onMounted(() => {
    loadFilesTest()
})
```
Console output:
```
C:\...\debug\test\exists.json exists with base dir:  true
C:\...\debug\test\does_not_exist.json exists with base dir:  false
C:\...\debug\test\exists.json exists with path api:  true
```

Uncommenting the `file_does_not_exist_path` parts result in `Uncaught (in promise) forbidden path:`.

### Expected behavior

The expected behavior is for it to return `false`, the same as when using `baseDir`.

### Full `tauri info` output

```text
> keymap_overlay@0.1.0 tauri
> tauri info


[✔] Environment
    - OS: Windows 10.0.22631 x86_64 (X64)
    ✔ WebView2: 131.0.2903.112
    ✔ MSVC:
        - Visual Studio Build Tools 2019
        - Visual Studio Community 2022
    ✔ rustc: 1.83.0 (90b35a623 2024-11-26)
    ✔ cargo: 1.83.0 (5ffbef321 2024-10-29)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 20.3.1
    - pnpm: 8.6.3
    - npm: 9.6.7

[-] Packages
    - tauri 🦀: 2.1.1
    - tauri-build 🦀: 2.0.3
    - wry 🦀: 0.47.2
    - tao 🦀: 0.30.8
    - @tauri-apps/api : 2.2.0
    - @tauri-apps/cli : 2.2.2

[-] Plugins
    - tauri-plugin-fs 🦀: 2.2.0
    - @tauri-apps/plugin-fs : 2.2.0

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: Vue.js
    - bundler: Vite
```


### Stack trace

_No response_

### Additional context

Thanks to @FabianLars I found out this same issue had been raised previously (https://github.com/tauri-apps/tauri/issues/11614), but was marked as closed.