Skip to content

Linux AppImage backend crashes: missing @yuuang/ffi-rs-linux-x64-gnu optional dependency #3812

Description

@Prgm-code

Summary

The Linux AppImage for v0.0.29-nightly.20260708.758 crashes its backend process on startup because the native optional dependency @yuuang/ffi-rs-linux-x64-gnu is missing from the packaged app.

The visible Electron dialog only says:

A JavaScript error occurred in the main process
Uncaught Exception:
Error: read ECONNRESET
    at Pipe.onStreamRead (node:internal/stream_base_commons:216:20)

But the actual backend failure in ~/.t3/userdata/logs/server-child.log is:

Error: Cannot find module '@yuuang/ffi-rs-linux-x64-gnu'
Require stack:
- /tmp/.mount_T3-Cod.../resources/app.asar/node_modules/ffi-rs/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1483:15)
    at wrapResolveFilename (node:internal/modules/cjs/loader:1056:27)
    at defaultResolveImplForCJSLoading (node:internal/modules/cjs/loader:1080:10)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1101:12)
    at Module._load (node:internal/modules/cjs/loader:1269:25)
    at c._load (node:electron/js2c/node_init:2:18060)
    at wrapModuleLoad (node:internal/modules/cjs/loader:262:19)
    at Module.require (node:internal/modules/cjs/loader:1583:12)
    at require (node:internal/modules/helpers:153:16)
    at Object.<anonymous> (/tmp/.mount_T3-Cod.../resources/app.asar/node_modules/ffi-rs/index.js:184:31) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/tmp/.mount_T3-Cod.../resources/app.asar/node_modules/ffi-rs/index.js'
  ]
}

Node.js v24.15.0

The desktop process then keeps restarting the backend, which makes the read ECONNRESET dialog appear repeatedly.

Affected build

T3-Code-0.0.29-nightly.20260708.758-x86_64.AppImage
Release tag: v0.0.29-nightly.20260708.758
Published: 2026-07-08

Environment

OS: CachyOS Linux (Arch-based rolling)
Kernel: 7.1.3-1-cachyos
Arch: x86_64
Display: Wayland
Install format: AppImage

Steps to reproduce

  1. Download T3-Code-0.0.29-nightly.20260708.758-x86_64.AppImage.
  2. Run it on Linux x86_64.
  3. Wait for the backend startup.
  4. Dismiss the Electron read ECONNRESET dialog.
  5. Observe that the dialog keeps reappearing as the backend restarts and crashes again.

Expected behavior

The AppImage should include/load the Linux x64 GNU native binding for ffi-rs, start the backend, and open the main window.

Actual behavior

The backend exits with code 1 because it cannot resolve @yuuang/ffi-rs-linux-x64-gnu. The frontend/main Electron process reports read ECONNRESET because the backend pipe/socket is closed.

Packaging observation

Extracting the AppImage shows ffi-rs is present:

resources/app.asar.unpacked/node_modules/ffi-rs
resources/app.asar.unpacked/node_modules/ffi-rs/index.js
resources/app.asar.unpacked/node_modules/ffi-rs/package.json

But the Linux native optional dependency is not present:

resources/app.asar.unpacked/node_modules/@yuuang/ffi-rs-linux-x64-gnu

In ffi-rs@1.3.2, package.json lists it as an optional dependency:

"optionalDependencies": {
  "@yuuang/ffi-rs-linux-x64-gnu": "1.3.2"
}

And ffi-rs/index.js tries to require it on Linux x64 GNU when the local .node file is absent:

nativeBinding = require('@yuuang/ffi-rs-linux-x64-gnu')

Workaround

Installing the missing native package outside the AppImage and launching T3 Code with NODE_PATH works:

mkdir -p ~/t3-native-fix
cd ~/t3-native-fix
npm init -y
npm install @yuuang/ffi-rs-linux-x64-gnu@1.3.2

NODE_PATH="$HOME/t3-native-fix/node_modules${NODE_PATH:+:$NODE_PATH}" \
  /path/to/T3-Code-0.0.29-nightly.20260708.758-x86_64.AppImage

With this workaround, startup reaches:

backend ready
main window created

So this appears to be a Linux AppImage packaging regression around an optional native dependency rather than a system-level AppImage/FUSE problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions