tauri: [bug] creating a project cause thread panic

Describe the bug

The problem is when creating a brand new project I got some issue to run it

> test@0.1.0 tauri /path/to/Developer/DofusFM2/test
> tauri "dev"

thread '<unnamed>' panicked at crates/tauri-cli/src/helpers/app_paths.rs:117:5:
Couldn't recognize the current folder as a Tauri project. It must contain a `tauri.conf.json`, `tauri.conf.json5` or `Tauri.toml` file in any subfolder.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 ELIFECYCLE  Command failed.
zsh: abort      pnpm tauri dev
pwd
/Users/name/Developer/FM2/test

Talked with @FabianLars on discord and it looked like forcing the cli version on both cargo and pnpm to tauri-cli 2.0.3 fix the issue

Reproduction

pnpm create tauri-app
✔ Project name · test
✔ Identifier · com.test.app
✔ Choose which language to use for your frontend · TypeScript / JavaScript - (pnpm, yarn, npm, deno, bun)
✔ Choose your package manager · pnpm
✔ Choose your UI template · React - (https://react.dev/)
✔ Choose your UI flavor · TypeScript

Template created! To get started, run:
  cd test
  pnpm install
  pnpm tauri android init
  pnpm tauri ios init

For Desktop development, run:
  pnpm tauri dev

For Android development, run:
  pnpm tauri android dev

For iOS development, run:
  pnpm tauri ios dev
cd test
pnpm i
 WARN  GET https://registry.npmjs.org/@tauri-apps%2Fcli error (ENOTFOUND). Will retry in 10 seconds. 2 retries left.
Packages: +71
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 119, reused 71, downloaded 0, added 71, done

dependencies:
+ @tauri-apps/api 2.0.3
+ @tauri-apps/plugin-shell 2.0.1
+ react 18.3.1
+ react-dom 18.3.1

devDependencies:
+ @tauri-apps/cli 2.0.4
+ @types/react 18.3.12
+ @types/react-dom 18.3.1
+ @vitejs/plugin-react 4.3.3
+ typescript 5.6.3
+ vite 5.4.10

Done in 14s
pnpm tauri dev

> test@0.1.0 tauri /path/to/Developer/DofusFM2/test
> tauri "dev"

thread '<unnamed>' panicked at crates/tauri-cli/src/helpers/app_paths.rs:117:5:
Couldn't recognize the current folder as a Tauri project. It must contain a `tauri.conf.json`, `tauri.conf.json5` or `Tauri.toml` file in any subfolder.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 ELIFECYCLE  Command failed.
zsh: abort      pnpm tauri dev

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Mac OS 15.0.1 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
    ✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
    ✔ rustup: 1.27.1 (2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 20.11.1
    - pnpm: 9.11.0
    - yarn: 1.22.22
    - npm: 10.2.4
    - bun: 1.1.34

[-] Packages
    - tauri-cli 🦀: 2.0.4
    - @tauri-apps/api : 2.0.3
    - @tauri-apps/cli : 2.0.5

[-] Plugins

[-] App

Stack trace

No response

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 22 (11 by maintainers)

Commits related to this issue

Most upvoted comments

try to also not ignore src-tauri, i.e add !**/src-tauri

is this still an issue with latest tauri cli release?

you could also try setting TAURI_CLI_CONFIG_DEPTH=1

try to also not ignore src-tauri, i.e add !**/src-tauri

Nice!!!

it seems like you have some gitignore files in E:\.env\.gitignore, E:\.env\.win\.gitignore and E:\.env\.win\ws\.gitignore specifically E:\.env\.win\.gitignore has a rule that prevents our lookup to find the config file.