#Tauri V2 Beta Crashes on trying to drag a "data-tauri-drag-region"

1 messages · Page 1 of 1 (latest)

merry turret
#

Heyo!
Does anyone has this same problem?
I am making my own titlebar, however when am trying to drag or click on the titlebar the window the app crashes with this error msg:

  VITE v5.3.5  ready in 1462 ms

  ➜  Local:   http://localhost:1420/
  ➜  Network: use --host to expose
    Info Watching D:\tauriV2\src-tauri for changes...
   Compiling mist v0.0.0 (D:\tauriV2\src-tauri)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 11.08s

   Tauri Devtools v2.0.0-beta.5
   →   Local:   https://devtools.crabnebula.dev/dash/x/x

thread 'main' has overflowed its stack
 ELIFECYCLE  Command failed with exit code 4294967295.
 ELIFECYCLE  Command failed with exit code 3221225725.

The HTML Code:

<div data-tauri-drag-region class="titlebar">
    <div class="titlebar-button" id="titlebar-minimize">
        <img
        src="https://api.iconify.design/mdi:window-minimize.svg"
        alt="minimize"
        />
    </div>
    <div class="titlebar-button" id="titlebar-maximize">
        <img
        src="https://api.iconify.design/mdi:window-maximize.svg"
        alt="maximize"
        />
    </div>
    <div class="titlebar-button" id="titlebar-close">
        <img src="https://api.iconify.design/mdi:close.svg" alt="close" />
    </div>
</div>

<style>
    .titlebar {
        height: 30px;
        background: #329ea3;
        user-select: none;
        display: flex;
        justify-content: flex-end;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
    }
    .titlebar-button {
        display: inline-flex;
        justify-content: center;
        align-items: center;
        width: 30px;
        height: 30px;
        user-select: none;
        -webkit-user-select: none;
    }
    .titlebar-button:hover {
        background: #5bbec3;
    }
</style>
spring kernel
#
  1. Do you have the unstable feature flag enabled? (i don't want you to do that, just wanna know what you currently use)
  2. Can you try it without the devtools plugin?
  3. If that doesn't help, maybe try this? https://github.com/tauri-apps/tauri/issues/9882#issuecomment-2196177515 - I don't think it's a good solution for event based crashes but maybe still worth a try.
merry turret
#

Also here is the infos:

[✔] Environment
    - OS: Windows 10.0.22621 X64
    ✔ WebView2: 126.0.2592.113
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.80.0 (051478957 2024-07-21)
    ✔ cargo: 1.80.0 (376290515 2024-07-16)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 21.6.1
    - pnpm: 8.15.6
    - yarn: 1.22.22
    - npm: 10.8.2
    - bun: 1.1.4

[-] Packages
    - tauri [RUST]: 2.0.0-beta.24
    - tauri-build [RUST]: 2.0.0-beta.19
    - wry [RUST]: 0.41.0
    - tao [RUST]: 0.28.1
    - tauri-cli [RUST]: 2.0.0-beta.14
    - @tauri-apps/api [NPM]: 2.0.0-beta.15
    - @tauri-apps/cli [NPM]: 2.0.0-beta.22

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../build
    - devUrl: http://localhost:1420/
    - framework: Svelte
    - bundler: Vite
spring kernel
#

Hmm, can you share your capabilities file too?

merry turret
#

{
  "$schema": "../gen/schemas/desktop-schema.json",
  "identifier": "default",
  "description": "Capability for the main window",
  "windows": [
    "main"
  ],
  "permissions": [
    "path:default",
    "event:default",
    "window:default",
    "app:default",
    "image:default",
    "resources:default",
    "menu:default",
    "tray:default",
    "shell:allow-open",
    "upload:default",
    "store:default",
    "os:default",
    "notification:default",
    "log:default",
    "http:default",
    "fs:default",
    "dialog:default",
    "autostart:default",
    "window:allow-start-dragging",
    "window:allow-close",
    "window:allow-toggle-maximize",
    "window:allow-minimize"
  ]
}```
#

even appWindow.minimize(), appWindow.toggleMaximize(), appWindow.close() won't work either.

spring kernel
#

Are there any errors in the devtools console?

#

with devtools i mean the webview inspector, not the plugin

#

also, is your app public?

merry turret
merry turret
#

ok

#

I managed to fix the appWindow.minimize(), appWindow.toggleMaximize(), appWindow.close() issues.

#

It seems like the log plugin was just spamming with logs messages and made the main window unusable

#

ok

#

so the code from CrabNebula in the troubleshoot > Log plugins
made the log plugin spam log messages every milliseconds and made the app unusable
Code from CrabNebula:

fn run() {
    let mut builder = tauri::Builder::default();

    #[cfg(debug_assertions)]
    {
        let devtools = tauri_plugin_devtools::init();
        builder = builder.plugin(devtools);
    }

    #[cfg(not(debug_assertions))]
    {
        use tauri_plugin_log::{Builder, Target, TargetKind};

        let log_plugin = Builder::default()
            .targets([
                Target::new(TargetKind::Stdout),
                Target::new(TargetKind::LogDir { file_name: None }),
                Target::new(TargetKind::Webview),
            ])
            .build();

        builder = builder.plugin(log_plugin);
    }

    builder
        .invoke_handler(tauri::generate_handler![greet])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

#[tauri::command]
fn greet(name: &str) -> String {
    format!("Hello, {}! You've been greeted from Rust!", name)
}

My fixed code for the log plugin too not spam log messages:

    let mut builder = tauri::Builder::default();

    #[cfg(not(debug_assertions))]
    {
        let devtools = tauri_plugin_devtools::init();
        builder = builder.plugin(devtools);
    }

    #[cfg(debug_assertions)]
    {
        use tauri_plugin_log::{Builder, Target, TargetKind};

        let log_plugin = Builder::default().build();

        builder = builder.plugin(log_plugin);
    }

    builder
        .plugin(tauri_plugin_dialog::init())
        .plugin(tauri_plugin_fs::init())
        .plugin(tauri_plugin_http::init())
        .plugin(tauri_plugin_notification::init())
        .plugin(tauri_plugin_os::init())
        .plugin(tauri_plugin_store::Builder::new().build())
        .plugin(tauri_plugin_upload::init())
        .plugin(tauri_plugin_shell::init())
        .invoke_handler(tauri::generate_handler![greet])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
#

But I still can't drag the window :/

merry turret
#

Is data-tauri-drag-region still usable?

#

or has that variable changed

merry turret
#

@spring kernel I fixed it. It was sveltekit styling issue dead