Skip to content

Windows: app hangs ~30s on launch then crashes (0xc0000409) — bundled node.exe cannot resolve \\?\-prefixed server.js path (EISDIR 'C:') #105

Description

@coolluo

Environment

  • OS: Windows 11 25H2 (x64)
  • EchoType: EchoType_1.3.0_x64-setup.exe and EchoType_1.3.2_x64-setup.exe (both affected)
  • WebView2 Runtime: 152.0.4191.66 (installed, not the problem)

Symptom

Double-click EchoType → process appears but shows no usable window ("Not Responding" if a window frame appears) → after ~30 seconds the process disappears silently. 100% reproducible on every launch, for both versions.

Windows Event Viewer (Application log) shows on every launch:

Faulting application name: echotype.exe, version: 1.3.0.0
Exception code: 0xc0000409          (BEX64, FAST_FAIL_FATAL_APP_EXIT, subcode 7)
Fault offset: 0x0000000000397f35

plus Application Hang (1002): The program echotype.exe stopped interacting with Windows.

Root cause

I captured the app's stderr by launching echotype.exe with redirected handles:

node:fs:2698
    const out = binding.lstat(pathModule.toNamespacedPath(base), false, undefined, true /* throwIfNoEntry */);
                        ^

Error: EISDIR: illegal operation on a directory, lstat 'C:'
    at Object.realpathSync (node:fs:2698:25)
    at toRealPath (node:internal/modules/helpers:58:13)
    at Module._findPath (node:internal/modules/cjs/loader:740:22)
    at resolveMainPath (node:internal/modules/run_main:34:23)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:156:24)

thread 'main' panicked at tauri-2.10.3\src\app.rs:1299:11:
Failed to setup app: error encountered during setup hook: Server failed to start within 30 seconds

What happens step by step:

  1. On Windows, the path built in src-tauri/src/sidecar.rs (get_server_path() / get_node_binary_path() via resource_dir()) ends up as a verbatim path with a \\?\ prefix (e.g. \\?\C:\Users\<user>\AppData\Local\EchoType\standalone\server.js).
  2. This verbatim path is passed as the entry-script argument to the bundled binaries\node.exe. Node.js cannot resolve a \\?\-prefixed entry path and exits immediately with EISDIR: illegal operation on a directory, lstat 'C:'.
  3. wait_for_server() then polls http://127.0.0.1:<port> for 30s while the main thread is blocked → the observed "hang / not responding".
  4. The setup hook returns an error → Tauri panics → with panic = "abort" this surfaces as 0xc0000409 (BEX64) → process dies.

Minimal reproduction of the Node.js failure

Using the bundled node binary directly:

:: Fails — exactly what the app does:
node.exe "\\?\C:\Users\<user>\AppData\Local\EchoType\standalone\server.js"
→ Error: EISDIR: illegal operation on a directory, lstat 'C:'

:: Works — same file without the verbatim prefix:
node.exe "C:\Users\<user>\AppData\Local\EchoType\standalone\server.js"
→ ▲ Next.js 16.1.6 ... ✓ Ready in 2.4s

Suggested fix

In src-tauri/src/sidecar.rs, strip the verbatim prefix before passing paths to Command, e.g.:

let server_path = dunce::simplified(&server_path).to_path_buf();
let node_path = dunce::simplified(&node_path).to_path_buf();

or simply pass a relative entry since current_dir is already the standalone dir:

Command::new(&node_path)
    .arg("server.js")
    .current_dir(&working_dir)
    ...

Workaround I verified locally

I replaced binaries\node.exe with a tiny shim that strips the \\?\ prefix from its arguments and forwards them to the real node (renamed to node_real.exe). With this shim the app starts normally: window appears, embedded server responds HTTP 200. So the rest of the app is fine — it's purely this path-handling issue at startup.


中文摘要

Windows 版启动必崩的原因:sidecar.rs 传给内置 node.exe 的 server.js 路径带 \\?\ 前缀,Node.js 解析不了这种 verbatim 路径而秒退(EISDIR 'C:'),Rust 侧等服务器 30 秒超时后 panic 崩溃。修复只需在传参前用 dunce::simplified() 去掉前缀,或直接传相对路径 server.js。所有 Windows 用户应该都会中招,建议尽快处理。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions