tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
79.88k stars 2.37k forks source link

Dialog can't be resolved #7511

Closed fprackwieser closed 11 months ago

fprackwieser commented 11 months ago

Describe the bug

I want to use the File Dialog in tauri.

use tauri::api::dialog::blocking::FileDialogBuilder;

But when trying to use this the error:

failed to resolve: could not find dialog in api

I've also noticed that the version of my Tauri isn't the latest even though I updated all my packages.

tauri = { version = "1.4.0", features = [] }

The latest stable release should be 1.4.1

Reproduction

I've used the standart installation guide for Svelte Kit + Tauri. I'm running it on WSL2.

Expected behavior

No response

Platform and versions

✔] Environment
    - OS: Ubuntu 22.04 X64
    ✔ webkit2gtk-4.0: 2.38.6
    ✔ rsvg2: 2.52.5
    ✔ rustc: 1.71.0 (8ede3aae2 2023-07-12)
    ✔ Cargo: 1.71.0 (cfd3bbd8f 2023-06-08)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 18.15.0
    - npm: 9.5.0

[-] Packages
    - tauri [RUST]: 1.4.1
    - tauri-build [RUST]: 1.4.0
    - wry [RUST]: 0.24.3
    - tao [RUST]: 0.16.2
    - @tauri-apps/api [NPM]: 1.4.0
    - @tauri-apps/cli [NPM]: 1.4.0

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../build
    - devPath: http://localhost:5173/
    - framework: Svelte
    - bundler: Vite

Stack trace

No response

Additional context

No response

FabianLars commented 11 months ago

in v1 the rust api is also bound to the allowlist that controls the js features which means you will have to allow the dialog api first and then after a re-run of tauri dev it will add the cargo feature flags. https://tauri.app/v1/api/js/dialog