Just installed the single instance plugin and its expecting an argument. I know practically nothing about rust so don't know what to provide it.
The plugin page says it should just work out the box so not sure what it wants.
Error message:
error[E0061]: this function takes 1 argument but 0 arguments were supplied
--> src\lib.rs:10:17
|
10 | .plugin(tauri_plugin_single_instance::init())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-- argument #1 is missing
|
note: function defined here
--> C:\Users\Ollie\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\tauri-plugin-single-instance-2.3.2\src\lib.rs:31:8
|
31 | pub fn init<R: Runtime, F: FnMut(&AppHandle<R>, Vec<String>, String) + Send + Sync + 'static>(
| ^^^^
help: provide the argument
|
10 | .plugin(tauri_plugin_single_instance::init(/* f */))
| +++++++
lib.rs
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
#[tauri::command]
fn greet(name: &str) -> String {
format!("Hello, {}! You've been greeted from Rust!", name)
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_single_instance::init())
.plugin(tauri_plugin_deep_link::init())
.plugin(tauri_plugin_fs::init())
.plugin(tauri_plugin_opener::init())
.invoke_handler(tauri::generate_handler![greet])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
Tauri info:
[✔] Environment
- OS: Windows 10.0.19045 x86_64 (X64)
✔ WebView2: 138.0.3351.121
✔ MSVC: Visual Studio Community 2019
✔ rustc: 1.88.0 (6b00bc388 2025-06-23)
✔ cargo: 1.88.0 (873a06493 2025-05-10)
✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
- node: 22.7.0
- npm: 8.1.2
[-] Packages
- tauri :crab:: 2.7.0
- tauri-build :crab:: 2.3.1
- wry :crab:: 0.52.1
- tao :crab:: 0.34.0
- @tauri-apps/api : 2.7.0
- @tauri-apps/cli : 2.7.1
[-] Plugins
- tauri-plugin-deep-link :crab:: 2.4.1
- @tauri-apps/plugin-deep-link : 2.4.1
- tauri-plugin-fs :crab:: 2.4.1
- @tauri-apps/plugin-fs : 2.4.1
- tauri-plugin-opener :crab:: 2.4.0
- @tauri-apps/plugin-opener : 2.4.0
- tauri-plugin-single-instance :crab:: 2.3.2
- @tauri-apps/plugin-single-instance : 0.1.0
[-] App
- build-type: bundle
- CSP: unset
- frontendDist: ../dist
- devUrl: http://localhost:1420/
- framework: React
- bundler: Vite