tauri-apps/tauri

[bug] TAURI_FRONTEND_PATH and TAURI_APP_PATH have wrong semantics

Opened this issue · 0 comments

Describe the bug

I ran tauri init in gui folder and moved src-tauri folder to crates/tauri-app, and I should set variables to

export TAURI_FRONTEND_PATH="$(pwd)/crates/tauri-app"
export TAURI_APP_PATH="$(pwd)/gui"

for tauri-cli to work, but I think it should be opposite. I think fixing it would be a breaking change, so probably this could be mentioned somewhere

Reproduction

mkdir gui && cd gui
yarn create vite .
yarn add -D @tauri-apps/cli@latest
yarn tauri init
mv src-tauri ../crates/tauri-app

# swap
export TAURI_APP_PATH="../crates/tauri-app"
export TAURI_FRONTEND_PATH=.
yarn tauri dev

Expected behavior

App running

Full tauri info output

[✘] Environment
    - OS: NixOS 24.11.0 x86_64 (X64)
    ✔ webkit2gtk-4.1: 2.44.3
    ✘ rsvg2: not installed
      Visit https://v2.tauri.app/start/prerequisites/ to learn more about tauri prerequisites
    ✔ rustc: 1.82.0 (f6e511eec 2024-10-15)
    ✔ cargo: 1.82.0 (8f40fc59f 2024-08-21)
    ✔ rustup: 1.27.1 (1980-01-01)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 20.15.1
    - yarn: 4.4.1
    - npm: 10.8.2

[-] Packages
    - tauri 🦀: 2.0.6
    - tauri-build 🦀: 2.0.2
    - wry 🦀: 0.46.3
    - tao 🦀: 0.30.3
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli : 2.0.5

[-] Plugins
    - tauri-plugin-log 🦀: 2.0.1
    - @tauri-apps/plugin-log : not installed!

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../../gui/public
    - devUrl: http://localhost:8080/
    - framework: Svelte
    - bundler: Rollup

Stack trace

thread '<unnamed>' panicked at crates/tauri-cli/src/helpers/app_paths.rs:117:5:
Couldn't recognize the `TAURI_FRONTEND_PATH` folder as a Tauri project. It must contain a `tauri.conf.json`, `tauri.conf.json5` or `Tauri.toml` file in any subfolder.

Additional context

No response