Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] New 2.0 project not recognized as a Tauri project #12135

Closed
Dylan-Gresham opened this issue Jan 2, 2025 · 7 comments
Closed

[bug] New 2.0 project not recognized as a Tauri project #12135

Dylan-Gresham opened this issue Jan 2, 2025 · 7 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@Dylan-Gresham
Copy link

Dylan-Gresham commented Jan 2, 2025

Describe the bug

I'm attempting to create a new Tauri 2.0 project. I've been using v1 for a while now and wanted to play around with 2.0 before migrating my existing project over. When creating a new project with the yarn create tauri-app command, I get a project, install the dependencies, but when I run yarn tauri android init or yarn tauri dev I get the following error:

yarn run v1.22.22
$ tauri dev
thread '<unnamed>' panicked at crates/tauri-cli/src/helpers/app_paths.rs:119: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
error Command failed with signal "SIGABRT".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I followed the guides on starting a new project. I'm using the version of Node and npm shown in the prerequisites and the latest versions of everything else. My v1 project still runs just fine so I'm fairly certain it's either an issue with the latest version or my system.

Reproduction

Full steps and log:

> yarn create tauri-app
yarn create v1.22.22
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "[email protected]" with binaries:
      - create-tauri-app
[##########################################################################################################] 181/181t✔ 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 · yarn
✔ Choose your UI template · React - (https://react.dev/)
✔ Choose your UI flavor · TypeScript

Template created! To get started run:
  cd test
  yarn
  yarn tauri android init

For Desktop development, run:
  yarn tauri dev

For Android development, run:
  yarn tauri android dev

Done in 11.96s.

> cd test

> yarn                 
yarn install v1.22.22
warning package.json: "test" is also the name of a node core module
info No lockfile found.
warning [email protected]: "test" is also the name of a node core module
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 3.19s.

> yarn tauri android init
yarn run v1.22.22
warning package.json: "test" is also the name of a node core module
$ tauri android init
thread '<unnamed>' panicked at crates/tauri-cli/src/helpers/app_paths.rs:119: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
error Command failed with signal "SIGABRT".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

 > yarn tauri dev         
yarn run v1.22.22
warning package.json: "test" is also the name of a node core module
$ tauri dev
thread '<unnamed>' panicked at crates/tauri-cli/src/helpers/app_paths.rs:119: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
error Command failed with signal "SIGABRT".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Expected behavior

Expected the default Tauri + React page to open up when executing yarn tauri dev and the yarn tauri android init to execute properly.

Full tauri info output

> yarn tauri info
yarn run v1.22.22
warning package.json: "test" is also the name of a node core module
$ tauri info

[✔] Environment
    - OS: Arch Linux Unknown x86_64 (X64)
    ✔ webkit2gtk-4.1: 2.46.5
    ✔ rsvg2: 2.59.2
    ✔ rustc: 1.83.0 (90b35a623 2024-11-26)
    ✔ cargo: 1.83.0 (5ffbef321 2024-10-29)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 20.10.0
    - pnpm: 9.15.2
    - yarn: 1.22.22
    - npm: 10.2.3
    - bun: 1.1.42

[-] Packages
    - @tauri-apps/api : 2.2.0
    - @tauri-apps/cli : 2.1.0

[-] Plugins

[-] App
Done in 1.38s.

Stack trace

> RUST_BACKTRACE=full yarn tauri android init
yarn run v1.22.22
warning package.json: "test" is also the name of a node core module
$ tauri android init
thread '<unnamed>' panicked at crates/tauri-cli/src/helpers/app_paths.rs:119: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.
stack backtrace:
   0:     0x7d79514bbc89 - <unknown>
   1:     0x7d795100ddfb - <unknown>
   2:     0x7d79514811a2 - <unknown>
   3:     0x7d79514bf0f8 - <unknown>
   4:     0x7d79514bffb0 - <unknown>
   5:     0x7d79514bfa95 - <unknown>
   6:     0x7d79514bf9f9 - <unknown>
   7:     0x7d79514bf9e4 - <unknown>
   8:     0x7d7950f338c2 - <unknown>
   9:     0x7d7951675489 - <unknown>
  10:     0x7d79516eb598 - <unknown>
  11:     0x7d7950f5da0e - <unknown>
  12:     0x7d7950f66db5 - <unknown>
  13:     0x7d79514c2dfb - <unknown>
  14:     0x7d7978ca339d - <unknown>
  15:     0x7d7978d2849c - <unknown>
  16:                0x0 - <unknown>
error Command failed with signal "SIGABRT".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

 > RUST_BACKTRACE=full yarn tauri dev
yarn run v1.22.22
warning package.json: "test" is also the name of a node core module
$ tauri dev
thread '<unnamed>' panicked at crates/tauri-cli/src/helpers/app_paths.rs:119: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.
stack backtrace:
   0:     0x79e251cbbc89 - <unknown>
   1:     0x79e25180ddfb - <unknown>
   2:     0x79e251c811a2 - <unknown>
   3:     0x79e251cbf0f8 - <unknown>
   4:     0x79e251cbffb0 - <unknown>
   5:     0x79e251cbfa95 - <unknown>
   6:     0x79e251cbf9f9 - <unknown>
   7:     0x79e251cbf9e4 - <unknown>
   8:     0x79e2517338c2 - <unknown>
   9:     0x79e251e75489 - <unknown>
  10:     0x79e25175ef9c - <unknown>
  11:     0x79e251766db5 - <unknown>
  12:     0x79e251cc2dfb - <unknown>
  13:     0x79e2796a339d - <unknown>
  14:     0x79e27972849c - <unknown>
  15:                0x0 - <unknown>
error Command failed with signal "SIGABRT".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Additional context

I've attempted to use npm, pnpm, bun, and cargo instead of yarn and have gotten the same error.

Directory structure pre yarn install:

> tree
.
├── index.html
├── package.json
├── public
│   ├── tauri.svg
│   └── vite.svg
├── README.md
├── src
│   ├── App.css
│   ├── App.tsx
│   ├── assets
│   │   └── react.svg
│   ├── main.tsx
│   └── vite-env.d.ts
├── src-tauri
│   ├── build.rs
│   ├── capabilities
│   │   └── default.json
│   ├── Cargo.toml
│   ├── icons
│   │   ├── 32x32.png
│   │   ├── 128x128.png
│   │   ├── [email protected]
│   │   ├── icon.icns
│   │   ├── icon.ico
│   │   ├── icon.png
│   │   ├── Square30x30Logo.png
│   │   ├── Square44x44Logo.png
│   │   ├── Square71x71Logo.png
│   │   ├── Square89x89Logo.png
│   │   ├── Square107x107Logo.png
│   │   ├── Square142x142Logo.png
│   │   ├── Square150x150Logo.png
│   │   ├── Square284x284Logo.png
│   │   ├── Square310x310Logo.png
│   │   └── StoreLogo.png
│   ├── src
│   │   ├── lib.rs
│   │   └── main.rs
│   └── tauri.conf.json
├── tsconfig.json
├── tsconfig.node.json
└── vite.config.ts

More system info if relevant:

> sudo pacman -S --needed \
  webkit2gtk-4.1 \
  base-devel \
  curl \
  wget \
  file \
  openssl \
  appmenu-gtk-module \
  libappindicator-gtk3 \
  librsvg
warning: webkit2gtk-4.1-2.46.5-1 is up to date -- skipping
warning: base-devel-1-2 is up to date -- skipping
warning: curl-8.11.1-3 is up to date -- skipping
warning: wget-1.25.0-1 is up to date -- skipping
warning: file-5.46-2 is up to date -- skipping
warning: openssl-3.4.0-1 is up to date -- skipping
warning: appmenu-gtk-module-24.05-1 is up to date -- skipping
warning: libappindicator-gtk3-12.10.0.r298-4 is up to date -- skipping
warning: librsvg-2:2.59.2-1 is up to date -- skipping
 there is nothing to do

> rustup show  
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/midge/.rustup

installed targets for active toolchain
--------------------------------------

aarch64-linux-android
armv7-linux-androideabi
i686-linux-android
x86_64-linux-android
x86_64-unknown-linux-gnu

active toolchain
----------------

stable-x86_64-unknown-linux-gnu (default)
rustc 1.83.0 (90b35a623 2024-11-26)

> rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: checking for self-update

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.83.0 (90b35a623 2024-11-26)

info: cleaning up downloads & tmp directories

> node -v 
v20.10.0

 > npm -v               
10.2.3

> yarn -v        
1.22.22

> echo "$JAVA_HOME"
/opt/android-studio/jbr

> echo "$ANDROID_HOME"
/home/midge/Android/Sdk

> echo "$NDK_HOME"    
/home/midge/Android/Sdk/ndk/28.0.12674087

> rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
info: component 'rust-std' for target 'aarch64-linux-android' is up to date
info: component 'rust-std' for target 'armv7-linux-androideabi' is up to date
info: component 'rust-std' for target 'i686-linux-android' is up to date
info: component 'rust-std' for target 'x86_64-linux-android' is up to date

Yarn was installed from the AUR and not through npm.

  • OS: Arch Linux x86_64
  • Kernel: 6.12.7-arch1-1
  • Shell: zsh 5.9
  • DE: Hyprland
  • WM: sway
  • Terminal: kitty
  • CPU: AMD Ryzen 9 7950X
  • GPU NVIDIA GeForce RTX 4090
  • Memory 63,498 MiB
@Dylan-Gresham Dylan-Gresham added status: needs triage This issue needs to triage, applied to new issues type: bug labels Jan 2, 2025
@FabianLars
Copy link
Member

Can you simply try again? Looks like you tried it while our release workflow was still running. Also, did you try other names than test ?

@Dylan-Gresham
Copy link
Author

I've tried other names yes, same thing. Just ran it again for a new project called tauri-test-proj and got the same results.

@FabianLars
Copy link
Member

Do you have a .gitignore file somewhere that may include the tauri.conf.json file? That's the only thing that i can think of rn

@Dylan-Gresham
Copy link
Author

Dylan-Gresham commented Jan 2, 2025

Nope, just to cover all the bases I checked the root of the project and all subdirs' .gitignores and none had the tauri.conf.json file included in them. Tried deleting all (2, one in the root of the project and one in the src-tauri directory) .gitignores in case something else was being ignored and still got the same errors.

@FabianLars
Copy link
Member

Nope, just to cover all the bases I checked the root of the project and all subdirs'

The ones i had in mind would be in parent dirs, or a global gitignore.

@tanjilbhuiyan
Copy link

was similarly trying. for last hour and half. Expected the default Tauri + React page to open up when executing pnpm tauri dev. Does not work.
Only if you choose rust language , it works, else does not.

@Dylan-Gresham
Copy link
Author

Nope, just to cover all the bases I checked the root of the project and all subdirs'

The ones i had in mind would be in parent dirs, or a global gitignore.

Ah! That was it, for some reason I had a .gitignore file in $HOME that was literally:

> cat ~/.gitignore
*

Removing that file fixed my issue. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

3 participants