Open thewh1teagle opened 2 days ago
Seems like we use ICoreWebView2Environment10
which requires 101+ to support setting incognito mode, maybe we can skip that cast if we don't use incognito
?
https://github.com/tauri-apps/wry/blob/f9e6bcc032369c6d5e7ce0284406953a16da3d82/src/webview2/mod.rs#L330-L331 https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2environment10?view=webview2-1.0.2478.35 https://learn.microsoft.com/en-us/microsoft-edge/webview2/release-notes/archive?tabs=dotnetcsharp#10121039
Seems like this is also when theme API gets added, probably could document when it's added and skip it instead of returning error for unsupported platforms
Let me catch such errors
I might be wrong but looks like you're using expect
here?
I might be wrong but looks like you're using
expect
here?
Let me catch such errors. currently I don't get anything from it. I even have a panic hook, but it doesn't kick in since seems like the event loop just keep runing.
I don't quite get it to be honest, expect
will panic the thread on error, if you want to handle the error you can just use the returned Result
from it or do you mean it's crashing at somewhere else?
I don't quite get it to be honest,
expect
will panic the thread on error, if you want to handle the error you can just use the returnedResult
from it or do you mean it's crashing at somewhere else?
Sorry, I should have explained it better. Even though I'm using expect
, it never gets there. Like I said, if the webview fails to start (like with an old version), tauri logs the error, but expect
isn't hit, and the event loop just keeps running. Hope that makes more sense!
Ah, got it
C:\Users\1234>[2024-06-30T23:19:39Z DEBUG vibe_desktop] Vibe App Running [2024-06-30T23:19:39Z ERROR tauri_runtime_wry] failed to create webview: WebView2 error: WindowsError(Error { code: HRESULT(0x80004002), message: "No such interface supported" }) [2024-06-30T23:19:39Z DEBUG vibe_desktop::setup] webview version: 100.0.1185.36 [2024-06-30T23:19:39Z DEBUG vibe_desktop::setup] CPU Features: AVX: true AVX2: true AVX512: true AVX512-VBMI: true AVX512-VNNI: true FMA: true F16C: true [2024-06-30T23:19:39Z DEBUG vibe_desktop::setup] COMMIT_HASH: cc1bb4f721a794c58081b139e57808c6ec8e00a5
Looking at this, it seems like the failed to create webview
error happened before WebviewWindowBuilder::build
, presumably before the whole setup function, and that probably explained why the panic hook didn't work
It seems like it's creating windows before setup hook which should be from config files but I don't see any windows from your config files, pretty strange
and that probably explained why the panic hook didn't work
In addition the process kept running (the process was still listed in task manager)
Is it possible to also detect an outdated webview version and ask the user to update?
Yes, with webview_version
Describe the problem
Some users have an old version of webview2. if it's too old, the internal function create_webview will fail to run, tauri will log the error, but the app will still run in the background without show any error or crash the thread.
Describe the solution you'd like
Let me catch such errors. currently I don't get anything from it. I even have a panic hook, but it doesn't kick in since seems like the event loop just keep runing.
Alternatives considered
-
Additional context
https://github.com/thewh1teagle/vibe/issues/153#issuecomment-2198800744