tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] Couldn't recognize the current folder as a Tauri project

Open The-Mr-L opened this issue 4 years ago • 19 comments

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

The-Mr-L avatar Feb 21 '22 10:02 The-Mr-L

I dont know why the link dossnt work tho

The-Mr-L avatar Feb 21 '22 10:02 The-Mr-L

thank you for edit! @amrbashir

The-Mr-L avatar Feb 21 '22 12:02 The-Mr-L

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.

lucasfernog avatar Feb 21 '22 12:02 lucasfernog

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.

The-Mr-L avatar Feb 21 '22 13:02 The-Mr-L

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 :)

The-Mr-L avatar Feb 21 '22 14:02 The-Mr-L

Yeah you shouldn't gitignore the src-tauri folder.

For the android development, check out the tao-wry channel on our Discord.

lucasfernog avatar Feb 21 '22 14:02 lucasfernog

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:

slch avatar May 26 '22 17:05 slch

Still not working, have created local git repo, no git repo in ~, still the same error in a fresh-created project.

dyzdyz010 avatar Feb 14 '24 14:02 dyzdyz010

This is still broken. Can we reopen this?

rmburg avatar Nov 20 '24 19:11 rmburg

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

rmburg avatar Nov 20 '24 19:11 rmburg

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...

sirenoremac avatar Dec 18 '24 21:12 sirenoremac

you save my life!! @rmburg

JimmyLv avatar Dec 28 '24 07:12 JimmyLv

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.

cordx56 avatar Jan 12 '25 07:01 cordx56

I've opened #12791 with a fix.

rmburg avatar Feb 23 '25 14:02 rmburg

Placing !* at first line of .gitignore in projects folder helps.

frusanov avatar Mar 02 '25 11:03 frusanov

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.

abdubanna avatar Mar 16 '25 13:03 abdubanna

this will change in 2.4.0 btw - no more parent folder lookup

FabianLars avatar Mar 16 '25 13:03 FabianLars

@FabianLars I still have this problem with 2.48.1

abdubanna avatar Mar 16 '25 13:03 abdubanna

oh you meant tauri

abdubanna avatar Mar 16 '25 13:03 abdubanna