[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
Area#
Build, CI, or release tooling
Steps to reproduce#
- Install T3 Code (Nightly)
0.0.29-nightly.20260708.758on macOS arm64 (Apple Silicon). - Launch it.
Or from a clean checkout at the .758 commit (0c6656585):
pnpm installnode scripts/build-desktop-artifact.ts --platform mac --target dir --arch arm64npx @electron/asar list "<built .app>/Contents/Resources/app.asar" | grep ffi-rs→ffi-rsis 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.
- #3772 bumped
pnpm@10.24.0 → 11.10.0. pnpm ≥ 10.29.3 reports deduped deps differently (pnpm/pnpm#10601), and the electron-builder pnpm module collector silently drops those deps fromapp.asar. - #3790 bumped electron-builder
26.8.1 → 26.15.6, which restored the deduped prod deps (fixed thefast-checkcrash from #3789). - But
ffi-rs's optional native dep@yuuang/ffi-rs-darwin-arm64is still not collected into the asar, so.758(which includes #3790) crashes on it instead. The collection fix didn't cover platform-gatedoptionalDependencies.
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.
Electron-builder mis-detects the staged app's package manager as npm (its pnpm workspace-root probe chokes on pnpm 11 stdout noise, then falls back to npm_config_user_agent, which vp exec doesn't set). The npm collector then drops optional dep subtrees from the asar. The npm_config_user_agent fix in #3816 resolves this, verified on mac arm64.
juliusmarminge closed this
Sign in to join this conversation.
Confirming same for Windows