[bug] Couldn't recognize the current folder as a Tauri project
Describe the bug
hi, I am trying to upgrade from beta to the latest version, I am using the tauri vite plugin and the author of the project believes the problem is related to the cli. can you please take a look at the issue here: https://github.com/amrbashir/vite-plugin-tauri/issues/2#issuecomment-1046566383 thank you!
thread '' panicked at 'Couldn't recognize the current folder as a Tauri project. It must contain a tauri.conf.json or tauri.conf.json5 file in any subfolder.', src\helpers\app_paths.rs:64:4
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Reproduction
No response
Expected behavior
builds
Platform and versions
Windows 10
@tauri-apps/cli v1.0.0-rc.5
Stack trace
No response
Additional context
project structure:
dist
node_modules
public
srs
src-tauri
I dont know why the link dossnt work tho
thank you for edit! @amrbashir
Can you provide the steps you used to create your project or a test project on GitHub? I couldn't reproduce this with the vanilla Vite template. Also make sure you don't have the src-tauri folder on your .gitignore file.
well the only thing I did was running pnpm upgrade and cargo upgrade and update using cargo edit. before this it worked fine with the beta version. and the folder structure is standard I have not made any changes . I will look more into it as soon I have some more time. thank you for your time.
wow okay when I first read your comment I forgot that I am ignoring the src-tauri folder in git. but what has change? that makes this not work anymore?? :) I had no idea this would have that effect. but it works now! thanks again for your time. btw what is the status of android development it sounds interesting? just in a few words :)
Yeah you shouldn't gitignore the src-tauri folder.
For the android development, check out the tao-wry channel on our Discord.
Was wondering why getting the same error on fresh project. Same with different templates.
The issue was having a git repo in ~ - for dot files.
Creating a local git repo for project solved the problem :ok_hand:
Still not working, have created local git repo, no git repo in ~, still the same error in a fresh-created project.
This is still broken. Can we reopen this?
In my case, I had a .gitignore file in ~ which ignored the entire project. This causes the CLI to fail, even if src-tauri/tauri.conf.json exists in my cwd. This worked with tauri v1, and broke with v2 for me
Reproducible on MacOS: Create a .gitignore in ~ and put an asterisk in it Create a new Tauri project anywhere at all within ~ Try to run Tauri, and it will fail with this error I don't know much about this, but it seems clear that Tauri is affected by .gitignore files anywhere in the folder hierarchy that it is run from. Seems like it would be more sensible to only look at .gitignore's at perhaps the parent folder that it is run from? Not sure, as I don't really know what all it is doing with the .gitignore, but fundamentally it seems strange that a file WAY outside of the project's structure is affecting it. For some background, I believe I had a .gitignore created in ~ by venv, which seems like a fairly common thing for developers to be using...
you save my life!! @rmburg
Hi, I feel this behavior is something like bugs. But this Issue is closed without any plan to fix.
Is this problem will not fixed or no plans to fix?
I placed .gitignore at ~ from ten years ago, and Tauri is only the project occurs this situation.
I've opened #12791 with a fix.
Placing !* at first line of .gitignore in projects folder helps.
A .gitignore file in a parent directory applies to all its subdirectories.
Make sure there is no .gitignore file in an upper folder that might be affecting your inner ones. More importantly, check if it contains a *, which could be ignoring everything. This is especially relevant if you're managing your dotfiles in a git repository.
this will change in 2.4.0 btw - no more parent folder lookup
@FabianLars I still have this problem with 2.48.1
oh you meant tauri