You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disclaimer: I'm brand new to Rust and to Tauri; just spun up my first app with the beta today.
The docs provide some example code to illustrate how to make a "splash screen" (separate window / webview) and display it while the main application loads. However, when I tried it I encountered errors.
Error messages during compilation
Compiling app v0.1.0 (/home/jquant/tmp/tauri-app-hello/src-tauri)
error: only a single item `async` is currently allowed
--> src/main.rs:10:18
|
10 | #[tauri::command(with_window)]
| ^^^^^^^^^^^
...
23 | .invoke_handler(tauri::generate_handler![close_splashscreen])
| -------------------------------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0405]: cannot find trait `Params` in this scope
--> src/main.rs:11:26
|
11 | fn close_splashscreen<M: Params>(window: tauri::Window<M>) {
| ^^^^^^ not found in this scope
|
help: consider importing this trait
|
11 | use tauri::Params;
|
error: aborting due to 2 previous errors
Then I tried adding use tauri::Params; (at the top of main.rs)
Second round of error messages
Compiling app v0.1.0 (/home/jquant/tmp/tauri-app-hello/src-tauri)
error: only a single item `async` is currently allowed
--> src/main.rs:11:18
|
11 | #[tauri::command(with_window)]
| ^^^^^^^^^^^
...
24 | .invoke_handler(tauri::generate_handler![close_splashscreen])
| -------------------------------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no method named `get_webview` found for struct `Window<M>` in the current scope
--> src/main.rs:14:36
|
14 | if let Ok(splashscreen) = window.get_webview("splash") {
| ^^^^^^^^^^^ method not found in `Window<M>`
error[E0599]: no method named `get_webview` found for struct `Window<M>` in the current scope
--> src/main.rs:18:10
|
18 | window.get_webview("main").unwrap().show().unwrap();
| ^^^^^^^^^^^ method not found in `Window<M>`
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0599`.
error: could not compile `app`
Looking at the API docs, I see window.struct, but it has no get_webview method, so I'm not sure where this functionality is. In fact, doing a GitHub search for get_webview produced exactly 1 result, which was the splash screen example where I obtained the code that doesn't seem to work. Digging a little more, I found a method of the same name in WRY's webview2 source.
Disclaimer: I'm brand new to Rust and to Tauri; just spun up my first app with the beta today.
The docs provide some example code to illustrate how to make a "splash screen" (separate window / webview) and display it while the main application loads. However, when I tried it I encountered errors.
Error messages during compilation
Then I tried adding
use tauri::Params;
(at the top ofmain.rs
)Second round of error messages
Looking at the API docs, I see
window.struct
, but it has noget_webview
method, so I'm not sure where this functionality is. In fact, doing a GitHub search forget_webview
produced exactly 1 result, which was the splash screen example where I obtained the code that doesn't seem to work. Digging a little more, I found a method of the same name in WRY'swebview2
source.yarn tauri info
FWIW, my code is available at
jacobq/tauri-hello-world/tree/broken-splash
The text was updated successfully, but these errors were encountered: