tauri-vscode icon indicating copy to clipboard operation
tauri-vscode copied to clipboard

Needs to stress the requirement on tauri-cli.

Open Barafu opened this issue 2 years ago • 3 comments

If tauri-cli is not installed, trying to run the Build and Dev actions display very misleading error about cargo.toml file missing. Either the extension needs to check for this, or at least add a reminder to install tauri-cli in the extension description. VSCode recommends this extension when opening a tauri project, so you may assume that some users are building tauri app for the first time.

Barafu avatar Feb 20 '23 10:02 Barafu

Could you post the full error? the extension does check if tauri-cli is installed before trying to use it

amrbashir avatar Feb 20 '23 12:02 amrbashir

OK, so the steps are: On a new machine (I used Windows Sandbox on Win 11) install Rust, with dependencies, VSCode. Then do cargo install create-tauri-app, then cargo create-tauri-app. Choose cargo package manager and no frameworks. Open the folder in VSCode. It suggests Tauri extension and rust-analyzer. Install both. Restart VSCode. Run command: Tauri: Dev. It produces an error popup: "Couldn't detect package manager for current project.". Press hotkey for build task: "could not find Cargo.toml in C:\test\testrr or any parent directory". Then close VSCode and open src-tauri folder in it. Run Tauri: Dev. It reports "Tauri project not found".
Took me some time to understand that I missed cargo install tauri-cli.

Barafu avatar Feb 20 '23 13:02 Barafu

cargo create-tauri-app prints the instructions to install needed prerequisites including tauri-cli if you choose cargo as the package manager.

I will see if we can improve the errors a bit to direct you in the correct directions.

amrbashir avatar Feb 20 '23 13:02 amrbashir