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
[Windows] AppBuilder Setup function never called after updating to Tauri v0.8 #879
Comments
looks like Workaround: run this during your javascript application startup if (window.__TAURI_INVOKE_HANDLER__) {
window.__TAURI_INVOKE_HANDLER__({cmd: "__initialized"});
} else {
console.error("unable to call window.__TAURI_INVOKE_HANDLER__ to initialize tauri");
} |
Seems like the webview's It's weird because if I try to change the webview URL to |
Thanks for the workaround @chippers, Although it doesn't fully resolve things in my case. If I run I'm guessing with the workaround the JS side of Tauri isn't being fully initialized |
@simon-wh Yeah, looking at the code that isn't being run, it includes event initialization and plugin initialization. Here's a bit more involved workaround that works using the full reload. JS code: if (window.__TAURI_INVOKE_HANDLER__) {
window.__TAURI_INVOKE_HANDLER__({cmd: "__workaround"});
} else {
console.error("unable to call window.__TAURI_INVOKE_HANDLER__ to initialize tauri");
} Rust code: let mut workaround = true;
AppBuilder::new()
.setup(setup)
.invoke_handler(move |w, arg| {
if workaround && arg == r#"{"cmd":"__workaround"}"# {
workaround = false;
w.eval("window.location.reload()");
}
Ok(())
})
.build()
.run(); If you already have an invoke handler, all you need to add is the workaround boolean + the check to reload |
This is a binding issue and we're fixing it. Gonna be available on the next release. |
Closed by webview/webview_rust#35 |
Describe the bug
After updating to latest Tauri when running on Windows the Setup function is never called. I do not experience it on Linux, potentially indicating the issue being platform-specific.
When upgrading to the new version I removed the
edge
entry in mytauri.conf.json
, renamedwhitelist
toallowlist
and changed myhandle
calls toas_mut
I'm not able to get much debugging information from it, boiling it down I've got a single
println!
as the first line of thesetup
function which is never outputted.Platform and Versions (please complete the following information):
[tauri]: running info
Operating System - Windows_NT(10.0.18362) - win32/x64
Microsoft Edge - 44.18362.1.0_neutral__8wekyb3d8bbwe
Node.js environment
Node.js - 10.19.0
tauri.js - 0.10.0
Rust environment
rustc - 1.46.0-nightly
cargo - 1.46.0-nightly
tauri-bundler - 0.9.0
Global packages
NPM - 6.13.4
yarn - 1.22.0
App directory structure
/.git
/build
/node_modules
/public
/src
/src-tauri
/wooting-analog-midi
App
tauri.rs - 0.8.0
mode - embedded-server
build-type - bundle
CSP - default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'
distDir - ../build
devPath - http://localhost:3000
The text was updated successfully, but these errors were encountered: