tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] `tauri dev` cannot find binary path when `default-run` changed

Open bukowa opened this issue 1 year ago • 0 comments

Describe the bug

tauri dev cannot find my binary name when I changed default_run in Cargo.toml

$ just tauri dev
npm run --workspace=tauri-app tauri -- dev

> [email protected] tauri
> tauri dev

    Running BeforeDevCommand (`npm run dev`)

> [email protected] dev
> vite


  VITE v5.3.2  ready in 162 ms

  ➜  Local:   http://localhost:1420/
  ➜  Network: use --host to expose
    Info Watching C:\Users\buk\WebstormProjects\tauri-e2e\tauri-app\src-tauri for changes...
    Info Watching C:\Users\buk\WebstormProjects\tauri-e2e\tauri-app\src-tauri for changes...
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.34s
thread '<unnamed>' panicked at src\interface\rust\desktop.rs:88:63:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Reproduction

[package]
name = "tauri-app-rs"
version = "0.0.0"
description = "A Tauri App"
authors = ["you"]
edition = "2021"
default-run = "tauri-app"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
tauri-build = { version = "2.0.0-beta", features = [] }

[dependencies]
tauri = { version = "2.0.0-beta", features = [] }
tauri-plugin-shell = "2.0.0-beta"
serde = { version = "1", features = ["derive"] }
serde_json = "1"

[[bin]]
name = "tauri-app"
path = "src/main.rs"

Expected behavior

Works.

Full tauri info output

$ just tauri info
npm run --workspace=tauri-app tauri -- info

> [email protected] tauri
> tauri info

WARNING: no lock files found, defaulting to npm

[✔] Environment
    - OS: Windows 10.0.19045 X64
    ✔ WebView2: 126.0.2592.68
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.79.0 (129f3b996 2024-06-10)
    ✔ cargo: 1.79.0 (ffa9cf99a 2024-06-03)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 22.2.0
    - pnpm: 9.1.2
    - npm: 10.8.1
    - bun: 1.1.12

[-] Packages
    - tauri [RUST]: 2.0.0-beta.22
    - tauri-build [RUST]: 2.0.0-beta.17
    - wry [RUST]: 0.40.1
    - tao [RUST]: 0.28.1
    - @tauri-apps/api [NPM]: 2.0.0-beta.13
    - @tauri-apps/cli [NPM]: 2.0.0-beta.20

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - bundler: Vite

Stack trace

No response

Additional context

Probably here https://github.com/tauri-apps/tauri/blob/e7fd7c60d6693944e343fd8d615ec7871f31244b/tooling/cli/src/interface/rust.rs#L846

bukowa avatar Jun 29 '24 20:06 bukowa