tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] STATUS_ENTRYPOINT_NOT_FOUND when using `tauri::Window` in library tests on Windows

Open zhristophe opened this issue 3 weeks ago • 3 comments

Describe the bug

I am encountering a STATUS_ENTRYPOINT_NOT_FOUND (0xc0000139) error when running cargo test on Windows. The issue occurs in a library crate that depends on tauri (v2.x). Specifically, if a function signature in the library references tauri::Window (e.g., Option<tauri::Window>), and this function is called (or even just linked) in a test, the test process fails to start with STATUS_ENTRYPOINT_NOT_FOUND.

This happens even without any other dependencies (like image). The mere presence of tauri::Window in the test binary's symbol table seems to trigger this on Windows.

Reproduction

  1. Environment: Windows 10/11, Rust stable.
  2. Setup: Create a Cargo workspace.
  3. Crate: Create a library crate (e.g., repro) within the workspace.
  4. Dependencies: Add tauri to repro/Cargo.toml.
  5. Code: In repro/src/lib.rs:
// Function that references tauri::Window
pub fn use_window(_window: Option<tauri::Window>) {
    println!("Using window");
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_repro() {
        // Calling this triggers the error
        use_window(None);
    }
}
  1. Run: Execute cargo test -p repro.

Expected behavior

The test should pass (or fail normally).

Actual Behavior

The test executable fails to start. Output:

error: test failed, to rerun pass `-p repro --lib`

Caused by:
  process didn't exit successfully: ... (exit code: 0xc0000139, STATUS_ENTRYPOINT_NOT_FOUND)

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.26200 x86_64 (X64)
    ✔ WebView2: 142.0.3595.94
    ✔ MSVC: Visual Studio 生成工具 2022
    ✔ rustc: 1.91.1 (ed61e7d7e 2025-11-07)
    ✔ cargo: 1.91.1 (ea2d97820 2025-10-10)
    ✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (overridden by environment variable RUSTUP_TOOLCHAIN)
    - node: 24.11.1
    - pnpm: 10.22.0
    - npm: 11.6.2

[-] Packages
    - tauri-cli 🦀: 2.9.4

[-] Plugins

[-] App

Stack trace


Additional context

No response

zhristophe avatar Nov 29 '25 11:11 zhristophe

does it help if you add default-features = false to the tauri dependency? most of them (except wry perhaps) shouldn't be required for library crates.

FabianLars avatar Nov 30 '25 10:11 FabianLars

Can i work on this issue? please lmk

BOXER78 avatar Dec 01 '25 06:12 BOXER78

sure you can but we can't give you many pointers right now except to check whether https://github.com/tauri-apps/tauri/issues/13419 and https://github.com/tauri-apps/tauri/issues/13948 are related

FabianLars avatar Dec 01 '25 10:12 FabianLars