Skip to content

[Bug]: Nightly .758 still won't launch on macOS arm64 — @yuuang/ffi-rs-darwin-arm64 dropped from app.asar (#3790 didn't cover optional native deps) #3804

Description

@Atchferox

Area

Build, CI, or release tooling

Steps to reproduce

  1. Install T3 Code (Nightly) 0.0.29-nightly.20260708.758 on macOS arm64 (Apple Silicon).
  2. Launch it.

Or from a clean checkout at the .758 commit (0c6656585):

  1. pnpm install
  2. node scripts/build-desktop-artifact.ts --platform mac --target dir --arch arm64
  3. npx @electron/asar list "<built .app>/Contents/Resources/app.asar" | grep ffi-rsffi-rs is present, but its platform-specific optional dep is missing:
    ls "<built .app>/Contents/Resources/app.asar.unpacked/node_modules/@yuuang/"No such file or directory

Expected behavior

App launches and opens a window.

Actual behavior

The backend child process crash-loops at startup (code=1) and no renderer is ever spawned — dock icon appears but no window opens. The backend dies on:

Error: Cannot find module '@yuuang/ffi-rs-darwin-arm64'
Require stack:
- /Applications/T3 Code (Nightly).app/Contents/Resources/app.asar/node_modules/ffi-rs/index.js

@yuuang/ffi-rs-darwin-arm64 (the native binary for ffi-rs, an optional platform-gated dependency) is dropped from the packaged app — the entire app.asar.unpacked/node_modules/@yuuang/ directory is absent.

Root cause (analysis)

This is the follow-on to #3789 / #3790, one dependency deeper.

Confirmed by diffing the shipped bundles:

Build Relative to #3772 @yuuang/ffi-rs-darwin-arm64/ffi-rs.darwin-arm64.node in asar.unpacked
.751 before ✅ present
.758 after (+ #3790) ❌ absent

The dep is correctly declared in pnpm-lock.yaml (@yuuang/ffi-rs-darwin-arm64@1.3.2 as an optional of ffi-rs@1.3.2), so this is a bundling/collection gap for optional native deps, not a missing declaration.

Impact

Blocks work completely

Version or commit

0.0.29-nightly.20260708.758 (0c6656585)

Environment

macOS (Apple Silicon / arm64), Darwin 25.5.0

Logs or stack traces

{"message":"backend child process output","level":"ERROR","annotations":{"component":"desktop-backend-child","stream":"stderr",
"text":"Error: Cannot find module '@yuuang/ffi-rs-darwin-arm64'\nRequire stack:\n- .../app.asar/node_modules/ffi-rs/index.js\n
    at Module._resolveFilename (node:internal/modules/cjs/loader:1483:15) ..."}}

Observed ~412 times (backend exits code=1 and respawns).

Workaround

Roll back to a nightly before #3772 (e.g. .751) and block auto-update:
launchctl setenv T3CODE_DISABLE_AUTO_UPDATE 1 before relaunch.

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