Repository: tauri-apps/tauri (language: rust)

Issue:
[bug] New project fails to run dev build
### Describe the bug

I created a fresh project using `pnpm create tauri-app`.
Left everything on default except using Svelte.

Ran `pnpm i` in the project folder, followed by `pnpm tauri dev`.

Got the following error:

```
➜ pnpm tauri dev 

> splicerr@0.1.0 tauri C:\Users\Robert\Documents\Projects\splicerr
> tauri "dev"

    Running BeforeDevCommand (`pnpm dev`)

> splicerr@0.1.0 dev C:\Users\Robert\Documents\Projects\splicerr
> vite dev


  VITE v6.0.11  ready in 881 ms

  ➜  Local:   http://localhost:1420/
    Running DevCommand (`cargo  run --bins --no-default-features --color always --`)
error: unexpected argument '--bins' found

  tip: a similar argument exists: '--bin'
  tip: to pass '--bins' as a value, use '-- --bins'

Usage: cargo.exe run --bin [<NAME>] [ARGS]...

For more information, try '--help'.
    Info Watching C:\Users\Robert\Documents\Projects\splicerr\src-tauri for changes...
 ELIFECYCLE  Command failed with exit code 4294967295.
 ELIFECYCLE  Command failed with exit code 1.
```

I updated rust & cargo to the latest version using rustup, but the error persists.
My older tauri projects still build fine on the same system, but I can't create any new ones.

### Reproduction

Create new project using `create-tauri-app`.

Install dependencies.

Try to run dev build.

### Expected behavior

The dev app starts successfully.

### Full `tauri info` output

```text
➜ pnpm tauri info

> splicerr@0.1.0 tauri C:\Users\Robert\Documents\Projects\splicerr
> tauri "info"


[✔] Environment
    - OS: Windows 10.0.26100 x86_64 (X64)
    ✔ WebView2: 131.0.2903.146
    ✔ MSVC: Visual Studio Build Tools 2022
    ✔ rustc: 1.84.0 (9fc6b4312 2025-01-07)
    ✔ cargo: 1.84.0 (66221abde 2024-11-19)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 23.3.0
    - pnpm: 9.14.4
    - npm: 10.9.0

[-] Packages
    - tauri 🦀: 2.2.4
    - tauri-build 🦀: 2.0.5
    - wry 🦀: 0.48.1
    - tao 🦀: 0.31.1
    - @tauri-apps/api : 2.2.0
    - @tauri-apps/cli : 2.2.6

[-] Plugins
    - tauri-plugin-opener 🦀: 2.2.5
    - @tauri-apps/plugin-opener : 2.2.5

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

### Stack trace

```text

```

### Additional context

_No response_


Discussion / hints:
Same here
Issue happens for me when upgrading @tauri-apps/cli from 2.2.5 to 2.2.6. When reverting to previous version issue is not occurring.

> Issue happens for me when upgrading @tauri-apps/cli from 2.2.5 to 2.2.6. When reverting to previous version issue is not occurring.

I confirm last working version: "@tauri-apps/cli": "2.2.5"
same for me as well, on macos. I think I tracked the change down to this commit: [b61b2372b4e4a3018c87f240ab8](https://github.com/tauri-apps/tauri/commit/27096cdc05d89b61b2372b4e4a3018c87f240ab8)

Looks like the `--bins` was changed where it runs on desktop now.
i hate it here 😩 i'll push a fix asap sorrysorry

Fix patch:
diff --git a/.changes/fix-cli-bins.md b/.changes/fix-cli-bins.md
new file mode 100644
index 000000000000..83b425b7e4ab
--- /dev/null
+++ b/.changes/fix-cli-bins.md
@@ -0,0 +1,6 @@
+---
+tauri-cli: "patch:bug"
+"@tauri-apps/cli": "patch:bug"
+---
+
+Fixed an issue that caused `tauri dev` to fail because of an incorrect `--bins` flag.
diff --git a/crates/tauri-cli/src/interface/rust.rs b/crates/tauri-cli/src/interface/rust.rs
index b9da54da7b16..d3e6950db31d 100644
--- a/crates/tauri-cli/src/interface/rust.rs
+++ b/crates/tauri-cli/src/interface/rust.rs
@@ -382,8 +382,6 @@ fn dev_options(
 
   if mobile {
     args.push("--lib".into());
-  } else {
-    args.push("--bins".into());
   }
 
   if !args.contains(&"--no-default-features".into()) {
@@ -466,6 +464,8 @@ impl Rust {
       .push("tauri/custom-protocol".into());
     if mobile {
       args.push("--lib".into());
+    } else {
+      args.push("--bins".into());
     }
   }
 


Test patch: