Repository navigation
[Bug]: Linux AppImage 0.0.41-nightly.20260914.1687 returns HTTP 500 — static handler uses fs.open on app.asar #11710
Description
Activity
Triage
Accepted as a critical Linux AppImage host bug.
v0.0.41-nightly.20260914.1687(c07575f573dd) starts, logsbackend ready, thenGET /on the backend is HTTP 500. The desktop window cannot load on this nightly.This is not a duplicate of #11523. That issue is
t3code://apptruncating large JS chunks while HTTP returned 200. This one is the HTTP static handler itself failing onFileSystem.openagainstapp.asar. It is also not #10719 (ESM export mismatch) or #10517 (backend crash / blank window).openStaticFile -> PlatformError: NotFound: FileSystem.open (.../app.asar/apps/server/dist/client/index.html) ENOENT, apps/server/dist/client/index.html not found in .../app.asarfs.stat/fs.readFilesee a real 20 KBindex.html.fs.open/fs.promises.opendo not.What the code does
apps/server/src/http.ts(openStaticFile, from #9669) stats the file, thenFileSystem.opens it and streams 64 KB chunks.PlatformErroris mapped toInternal Server Error(500). Effect’s Node layer uses callbackfs.open(.repos/effect-smol/packages/platform/node-shared/src/NodeFileSystem.ts).Linux AppImages pack the web client into one
app.asar(scripts/build-desktop-artifact.ts). There is noasarUnpackforapps/server/dist/client. The backend isELECTRON_RUN_AS_NODE=1on the Electron binary (apps/desktop/src/backend/DesktopBackendConfiguration.ts), so it hits Electron’s asar-patchedfs.On Electron 44.1.0,
fs.openof a packed asar entry goes through temp extraction (copyFileOut).readFile/statread the archive directly. That matches this stack: file is present,openisENOENT. Electron 45 serves asar fds from the archive (electron#52833); 44 keeps the old path (electron#52804).http.tsdid not change between20260913.1625and1687. #11523’s HTTP 200 on assets is compatible with a file- or extraction-specificopenfailure (this report only showsGET /). On this nightly the renderer still proxiest3code://app→http://127.0.0.1:3773/(DesktopApp.tsbefore #9194). #9194 (cba7dd778, after 1687) serves the packaged renderer withFileSystem.readFileand unblocks the local window. Pairing, LAN, Tailscale, and other HTTP clients still hitopenStaticFileand stay broken. macOSapp.asarand Windowsserver.asaruse the same handler.No open PR fixes this.
Next step
- In
openStaticFile, fall back toFileSystem.readFilewhenopenfails (or when the path contains.asar). Keep handle streaming on a real filesystem. Unpackingapps/server/dist/client/**is an alternative, not required if the fallback exists. - Add a test where
stat/readFilesucceed andopenreturnsENOENT— response must be 200, not 500. - On 1687, check
GET /assets/*as well asGET /. Check macOS / Windows packaged hosts.
Workaround: an older AppImage. After #9194, a newer nightly may open the local window while HTTP static serving is still 500.
- In
- addedbugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.acceptedfeature request acceptedfeature request acceptedvia-triageFiled through npx t3 triageFiled through npx t3 triage
on Sep 14, 2026 I will address it
Also reproduces on macOS with the packaged stable build, not only the Linux AppImage.
- T3 Code 0.0.42 (commit 719a76c), macOS, Apple Silicon
curl -i http://127.0.0.1:3773/returns500 Internal Server Error- server trace:
openStaticFile -> PlatformError: NotFound: FileSystem.open (/Applications/T3 Code (Alpha).app/Contents/Resources/app.asar/apps/server/dist/client/index.html)
The desktop window itself loads fine (served via
t3code://app), but any browser client of the local server, including a paired browser onnetwork-accessiblemode, gets the 500.apps/server/src/http.tson main still usesfileSystem.openinopenStaticFile, and #11715 was closed unmerged, so this seems to still affect every packaged host.- added a commit that references this issue
on Oct 3, 2026
Summary
The Linux AppImage starts, but the backend returns HTTP 500 for
GET /. The desktop UI cannot load.Version
0.0.41-nightly.20260914.1687Steps to reproduce
T3-Code-0.0.41-nightly.20260914.1687-x86_64.AppImage.backend readyin~/.local/state/t3code/t3code.log.curl -i http://127.0.0.1:3773/.Actual result
Expected result
The backend returns the web client. The desktop UI loads.
Cause
The static handler calls
FileSystem.openon this path:The Electron asar layer fails the open call with
ENOENT:The file is present in the archive.
fs.statSyncreturns size 20143, andfs.readFileSyncreturns valid HTML.fs.openSyncandfs.promises.openfail withENOENT. Electron asar support implements stat and readFile, but not open.Regression
PR #9669 added the file-handle streaming path. That code returns 500 on
PlatformError. The failure occurs when the client files are insideapp.asar, as in the AppImage build.This is not #11523. #11523 reports truncated assets on the
t3code://path.Suggested fix
Read the file with
FileSystem.readFile, or mark the client directory as unpacked in the AppImage build.Workaround
Run an older AppImage.