tauri-apps/tauri · critical

error while running native webdriver

Error message

error while running native webdriver

What it means

tauri-driver (the WebDriver intermediary used by WebdriverIO/Selenium to test Tauri apps) spawns the platform-native WebDriver binary — WebKitWebDriver on Linux, msedgedriver.exe on Windows, or the path from --native-driver — and .spawn().expect("error while running native webdriver") panics when the process cannot be exec'd: broken binary path, missing executable bit, missing shared libraries, or OS process limits.

Source

Thrown at crates/tauri-driver/src/main.rs:45

#[cfg(any(target_os = "linux", windows))]
fn main() {
  let args = pico_args::Arguments::from_env().into();

  #[cfg(windows)]
  let _job_handle = {
    let job = win32job::Job::create().unwrap();
    let mut info = job.query_extended_limit_info().unwrap();
    info.limit_kill_on_job_close();
    job.set_extended_limit_info(&info).unwrap();
    job.assign_current_process().unwrap();
    job
  };

  // start the native webdriver on the port specified in args
  let mut driver = webdriver::native(&args);
  let driver = driver
    .spawn()
    .expect("error while running native webdriver");

  // start our webdriver intermediary node
  if let Err(e) = server::run(args, driver) {
    eprintln!("error while running server: {e}");
    std::process::exit(1);
  }
}

View on GitHub (pinned to 52e4b6e71d)

Solutions

  1. Install/repair the native driver: `sudo apt install webkit2gtk-driver` on Linux; ensure msedgedriver.exe is on PATH or passed via --native-driver on Windows
  2. Run the binary by hand to see the real exec error: `WebKitWebDriver --version` / `msedgedriver --version`; fix permissions (chmod +x) or missing libs (`ldd $(which WebKitWebDriver)`)
  3. Pass an explicit path: `tauri-driver --native-driver /usr/bin/WebKitWebDriver`
  4. Check CI process/thread limits if exec is refused despite a healthy binary

Example fix

# before: tauri-driver → panic: error while running native webdriver

# after
sudo apt install -y webkit2gtk-driver
ldd "$(command -v WebKitWebDriver)" | grep 'not found' && sudo apt install -y libwebkit2gtk-4.1-0
tauri-driver
Defensive patterns

Strategy: validation

Validate before calling

# bootstrap check before starting tauri-driver
command -v WebKitWebDriver >/dev/null || sudo apt install -y webkit2gtk-driver
WebKitWebDriver --version >/dev/null 2>&1 || { echo "native driver broken" >&2; ldd "$(command -v WebKitWebDriver)" | grep 'not found'; exit 1; }
tauri-driver

Prevention

When it happens

Trigger: tauri-driver starting while the native driver cannot exec: a --native-driver path that exists but is not executable, WebKitWebDriver found on PATH but failing to load (missing libwebkit2gtk), or fork/exec refused under CI process limits. (A binary entirely missing fails earlier in webdriver.rs with its own PATH error.)

Common situations: Linux CI with a broken webkit2gtk-driver installation; custom --native-driver paths from config variables that are empty/wrong on other machines; Windows without msedgedriver available; minimal container images lacking WebKitGTK runtime libs.

Related errors


AI-assisted analysis of tauri-apps/tauri@52e4b6e71d (2026-08-20). Data as JSON: /api/errors/c482320a40f7c892. Report an issue: GitHub.