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

[docs] Issue with cargo add Command for Tauri Plugin Installation #3029

Open
hosseinmobarakian opened this issue Nov 27, 2024 · 2 comments
Open

Comments

@hosseinmobarakian
Copy link

Hi,

I encountered a cargo error while trying to install a Tauri plugin in my project following the manual setup guide.

The original command I used was:

cargo add tauri-plugin-autostart --target 'cfg(any(target_os = "macos", windows, target_os = "linux"))'

This resulted in an error. However, when I modified the command to:

cargo add tauri-plugin-autostart --target 'cfg(any(target_os = "macos", target_os = "windows", target_os = "linux"))'

The issue was resolved, and the error disappeared.

It seems there’s a syntax inconsistency causing the problem. Could this be clarified in the documentation to prevent similar issues for other users?

Thank you!

@FabianLars
Copy link
Member

your modified command also didn't work for me (i don't see why it would work any better either) on windows but this worked

cargo add tauri-plugin-autostart --target 'cfg(any(target_os = \"macos\", target_os = \"windows\", target_os = \"linux\"))'

@FabianLars FabianLars transferred this issue from tauri-apps/tauri Nov 27, 2024
@hosseinmobarakian
Copy link
Author

You're right! The error occurs when an invalid category is added to the Cargo.toml file.

The correct format for Cargo.toml should be:

[target.'cfg(any(target_os = "macos", target_os = "windows", target_os = "linux"))'.dependencies]

Thank you for pointing this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants