Skip to content

Commit fd3a59a

Browse files
committed
fix: Fix multiremote capabilities structure handling in Tauri service
- Fix launcher to properly access tauri:options in multiremote capabilities structure - Add type assertion to handle multiremote vs standard capabilities differences - This should resolve 'Tauri application path not found in capabilities' warning
1 parent d9db4c4 commit fd3a59a

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

fixtures/build-cjs/simple-ts-config/rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// rollup.config.js (generated by @wdio/electron-bundler)
22
// Package: [email protected]
3-
// Generated: 2025-10-29T12:09:46.913Z
3+
// Generated: 2025-10-29T12:29:17.701Z
44
// Configurations: 2 (ESM, CJS)
55

66
// This file was auto-generated. Modifications will be overwritten.

fixtures/build-esm/simple-ts-config/rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// rollup.config.js (generated by @wdio/electron-bundler)
22
// Package: [email protected]
3-
// Generated: 2025-10-29T12:09:48.892Z
3+
// Generated: 2025-10-29T12:29:19.759Z
44
// Configurations: 2 (ESM, CJS)
55

66
// This file was auto-generated. Modifications will be overwritten.

fixtures/tauri-apps/basic/src-tauri/src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ async fn write_file(path: String, contents: String, _options: Option<FileOperati
130130
// Log immediately at the start of the function
131131
let _ = std::fs::write("/tmp/tauri-debug.log", "🔍 Rust: write_file function entry point reached\n");
132132
println!("🔍 Rust: write_file function entry point reached");
133-
133+
134134
let log_msg = format!("🔍 Rust: write_file called with path: '{}', contents length: {}, options: {:?}\n", path, contents.len(), _options);
135135
let _ = std::fs::write("/tmp/tauri-debug.log", log_msg.as_bytes());
136136
println!("🔍 Rust: write_file called with path: '{}', contents length: {}, options: {:?}", path, contents.len(), _options);
137-
137+
138138
// Add more detailed logging
139139
let log_msg2 = format!("🔍 Rust: About to write file '{}' with {} bytes\n", path, contents.len());
140140
let _ = std::fs::write("/tmp/tauri-debug.log", log_msg2.as_bytes());
@@ -184,11 +184,11 @@ async fn test_simple_params(param1: String, param2: i32) -> Result<String, Strin
184184
// Log immediately at the start of the function
185185
let _ = std::fs::write("/tmp/tauri-debug.log", "🔍 Rust: test_simple_params function entry point reached\n");
186186
println!("🔍 Rust: test_simple_params function entry point reached");
187-
187+
188188
let log_msg = format!("🔍 Rust: test_simple_params called with param1: '{}', param2: {}\n", param1, param2);
189189
let _ = std::fs::write("/tmp/tauri-debug.log", log_msg.as_bytes());
190190
println!("🔍 Rust: test_simple_params called with param1: '{}', param2: {}", param1, param2);
191-
191+
192192
Ok(format!("Received: param1='{}', param2={}", param1, param2))
193193
}
194194

@@ -240,7 +240,7 @@ async fn write_clipboard(content: String) -> Result<(), String> {
240240

241241
fn main() {
242242
let _ = std::fs::write("/tmp/tauri-debug.log", "🔍 Rust: Tauri v2 app starting...\n");
243-
243+
244244
tauri::Builder::default()
245245
.plugin(tauri_plugin_fs::init())
246246
.invoke_handler(tauri::generate_handler![

packages/tauri-service/src/launcher.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ export default class TauriLaunchService {
105105

106106
// App binary path is already resolved in onPrepare
107107
// The application path now points directly to the binary (not the app directory)
108-
const appBinaryPath = firstCap?.['tauri:options']?.application;
108+
// In multiremote, the structure is { capabilities: { 'tauri:options': ... } }
109+
// For standard capabilities, it's directly { 'tauri:options': ... }
110+
const appBinaryPath =
111+
(firstCap as any)?.capabilities?.['tauri:options']?.application || firstCap?.['tauri:options']?.application;
109112
if (!appBinaryPath) {
110113
log.warn('Tauri application path not found in capabilities, skipping diagnostics');
111114
log.debug(`Capabilities structure: ${JSON.stringify(firstCap, null, 2)}`);
@@ -116,13 +119,13 @@ export default class TauriLaunchService {
116119
log.debug(`Using app binary path: ${this.appBinaryPath}`);
117120

118121
// Verify the binary exists (it should, since we resolved it in onPrepare)
119-
if (!existsSync(this.appBinaryPath)) {
122+
if (!existsSync(this.appBinaryPath!)) {
120123
log.error(`Tauri binary not found: ${this.appBinaryPath}`);
121124
return;
122125
}
123126

124127
// Run environment diagnostics
125-
await this.diagnoseEnvironment(this.appBinaryPath);
128+
await this.diagnoseEnvironment(this.appBinaryPath!);
126129

127130
log.debug(`Tauri worker session started: ${cid}`);
128131
}

0 commit comments

Comments
 (0)