Closed thettler closed 1 week ago
same this sucks. thank you for figuring out it was tauri-plugin-devtools | devtools
it fixed it for me
This is possibly one of the wildest bugs I have seen to date. Just declaring (not even using) causes a different crate to malfunction, just wild. Thanks for reporting!
I have only today started investigating and I can already tell this is probably gonna be a longer process 😅 but it's promising a great writeup! Will keep this issue updated as I make progress on debugging this.
Edit 1: I don't have a windows VM handy, but this appears to be affecting macOS only
Edit 2: We have tracked down the issue. It is a pretty classic deadlock in the webviews_lock
method that comes down to essentially a race condition: When the window is created a we eval a script on the window that sets a few imported global properties. At the same time the underlying graphics toolkit is setting up the window and generating events corresponding to that. Usually, the evaling script step is fast enough that the lock is released before the first native window event is generated, however it seems with the tracing
feature enabled (which in-turn is used by the devtools plugin) this step takes just a bit too long and the native event is generated, caught by our handler which attempts to acquire another lock which then deadlocks.
@thettler while we are working on a proper fix for this, here is a simple workaround:
function openWindow() {
const pileWindow = new WebviewWindow('my-label', {
url: 'https://github.com/tauri-apps/tauri',
+ visible: false // initially hide the window
});
pileWindow.once('tauri://created', function () {
console.log('Success');
+ pileWindow.show(); // only show it after creation
});
pileWindow.once('tauri://error', function (e) {
console.log(e);
});
}
Describe the bug
i try to create a new WebviewWindow from JS Code but every time it just loads infinite and i need to force quit the Program.
I figured out that it has something to do with the
tauri-plugin-devtools
. If i remove it from the Cargo.toml it works.Cargo.toml
main.rs
Reproduction
Repo
Expected behavior
No response
Full
tauri info
outputStack trace
No response
Additional context
https://discord.com/channels/616186924390023171/1260259980435521686