Repository navigation
Desktop exits on launch in nightly 1700: dbus-next chunk re-requires main.cjs, registerSchemesAsPrivileged throws after ready #11720
Description
Activity
Triage
Accepted as a critical Linux desktop launch-blocker. Nightly
0.0.41-nightly.20260914.1700(01e05c152) exits with code 1 before a window appears.0.0.41-nightly.20260914.1687(c07575f573dd) still starts on the same machine and profile.This is not a duplicate of #10911 (intermittent Hyprland silent exit in 0.0.38, no
registerSchemesAsPrivilegederror). It is also not #11710 (asarfs.open→ HTTP 500) or #11523 (t3code://truncated assets). Those fail after the process is up.The filed
NODE_DEBUG=modulechain matches currentmain:- SnapShot bootstrap on Wayland (
captureMode("linux")→"portal") lazily loadsPortalCaptureShortcut(Hyprland) orNiriCaptureShortcut(Niri). - That chunk requires bundled
dbus-next. - The
dbus-nextchunk doesrequire("./main.cjs")to reachsax, which the bundler hoisted into the entry. - Node’s cache misses: the entry was loaded as
".", not./main.cjs. - A second
DesktopApp.program.pipe(..., runMain)runsDesktopPreReadyPlatform.layer→ElectronProtocol.layerSchemePrivilegesafterreadyand throws.runMainexits 1.
Error: protocol.registerSchemesAsPrivileged should be called before app is readyWhat the code does
#11410 (
683aa870) is in 1700 and not in 1687. It inlines the main-process tree (apps/desktop/vite.config.ts+scripts/lib/desktop-external-packages.ts) and leaves only native/Playwright packages on disk.dbus-next(andsax) used to be realnode_modulesin 1687; they are now insidedist-electron/*.cjs.apps/desktop/src/main.tsevaluatesrunMainat module top level.registerSchemesAsPrivilegedis documented as pre-ready-only (apps/desktop/src/electron/ElectronProtocol.ts).linuxCaptureSession.tsalready keepsdbus-nextoff the eager path; the lazy CJS chunk graph now points back at the entry.Same re-require is waiting on any post-ready
await importofLinuxSnapShot.ts/GnomeCaptureSetup.ts(DesktopSnapShot.state/ setup). Blast radius is Linux Wayland portal sessions, not only Hyprland.No open fix PR. Current HEAD is still
01e05c152.Next step
- Stop lazy CJS chunks from
require("./main.cjs"). Prefer a bundler fix (inlineDynamicImports, keepsaxin thedbus-nextchunk, or disable main-process code-splitting). Puttingdbus-nextback onDESKTOP_RUNTIME_EXTERNAL_PREFIXESis a valid 1687-shaped hotfix, not the long-term policy. - Do not “fix” this by ignoring
registerSchemesAsPrivilegedafter ready. A secondrunMainwould still start a second desktop program. - Add a packaging/bundle assertion: no
dist-electron/*.cjschunk mayrequire("./main.cjs"). Optionally guardmain.tsso a cache-miss re-entry is a no-op. - Smoke the packaged Linux AppImage on Wayland (Hyprland and at least one of GNOME/Niri) through
bootstrap backend start requestedand first SnapShot state read.
Workaround: extracted Nightly 1687. Avoid jumping to stable if this profile already ran 0.0.41 migrations.
- SnapShot bootstrap on Wayland (
Also hit this on Arch/Omarchy + Hyprland (Wayland), nightly 1700 → exits on launch, same
registerSchemesAsPrivileged should be called before app is readyerror, deterministic.Extra symptom: when the main process exits, the AppImage FUSE mount is torn down while the bundled server (
apps/server/dist/bin.mjs --bootstrap-fd 3) andSnapShotAccessibilityWorker.cjsare still running, so both die with SIGBUS (BUS_ADRERR) and leave systemd-coredump cores — can look like a native crash but is just a side effect.Workaround: downgrading to 0.0.41-nightly.20260911.1551 launches fine.
- 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 Same error here, also running Arch and Hyprland (
0.56.2), build 1687 is working fine but not 1700also hit on debian with hyprland 0.56.2 build 1700
Still reproduces on nightly
0.0.41-nightly.20260914.1707(9375c779707f), which is currentmain.- Same machine as the original report (Arch Linux x64, kernel 7.2.3, Hyprland 0.56.2, Wayland, AppImage extracted,
--no-sandbox). Deterministic: exit code 1 about 70 ms afterapp ready, with no window. - Same error at the same location:
ERROR (#160): Error: protocol.registerSchemesAsPrivileged should be called before app is ready at desktop.electron.protocol.registerSchemePrivileges (…/app.asar/apps/desktop/dist-electron/main.cjs:34390:118) - The 1707
app.asarstill hasconst require_main = require("./main.cjs");andrequire_main.require_sax()in thedbus-nextchunk. - 1700→1707 only adds fix(web): keep large image previews from stalling composer typing #11324, fix(server): avoid extra round trips for terminal output #11407, fix(web): remember panel width for each thread #11310, and fix(release): preserve updates from npm-based services #11732. None of them touch
apps/desktopor the bundler config, so this nightly has no fix. - After the main process exits, the bundled server (
bin.mjs --bootstrap-fd 3) andSnapShotAccessibilityWorker.cjskeep running as orphans, which matches @AntoineArt's SIGBUS note for FUSE-mounted runs.
Workaround still works: launch the extracted 1687 build directly.
Posted by Claude Code (Claude Opus 5,
claude-opus-5[1m]) viat3 triage.Reacted by Lorenzo and Johan Hillerström- Same machine as the original report (Arch Linux x64, kernel 7.2.3, Hyprland 0.56.2, Wayland, AppImage extracted,
Also reproduces on Fedora Linux 44 Workstation, GNOME Shell 50.4, Wayland.
T3 Code version: 0.0.41-nightly.20260914.1722
AppImage SHA-256: acf4467e4910eafbebfa7503f5a5ce05126b4ffcdbaa7a9959f3adce9314dc35Launch reaches "bootstrap backend start requested", then logs:
Error: protocol.registerSchemesAsPrivileged should be called before app is readyThe main process exits before a window appears. The orphaned server and
SnapShotAccessibilityWorker then crash with SIGBUS after the AppImage mount
is removed.Reacted by rayan6msAdditional reproduction from Arch Linux x86_64, installed as the
t3code-nightly-binAUR package viayay:0.0.41_nightly.20260914.1722-1: fails at launch.0.0.41-nightly.20260915.1735-1(b5b29e7): fails at launch.0.0.41_nightly.20260914.1687-1: last known good; launches normally.
Environment: Arch Linux, kernel
7.2.3-arch1-3,x86_64, Wayland session. The installed 1735 package reportsArchitecture: x86_64and is installed ast3code-nightly-bin.Exact reproduction:
pacman -Q t3code-nightly-bin ls -l /opt/t3code-nightly-bin/t3code timeout 20 /usr/bin/t3code-nightly --no-sandbox > /tmp/t3code-nightly.log 2>&1 echo $?
The 1735 run exits with code
1before a window appears. The relevant log excerpt is:ERROR (#158): Error: protocol.registerSchemesAsPrivileged should be called before app is ready at desktop.electron.protocol.registerSchemePrivileges (/opt/t3code-nightly-bin/resources/app.asar/apps/desktop/dist-electron/main.cjs:35862:118) INFO (#3): selected backend port via sequential scan port: 3775 startPort: 3773 INFO (#3): bootstrap resolved backend endpoint baseUrl: http://127.0.0.1:3775/The same exit code reproduces with
--no-sandbox --disable-gpuand--no-sandbox --ozone-platform=x11. The--disable-gpurun also ends withwrite EPIPEfromapps/desktop/dist-electron/snapShot/SnapShotAccessibilityWorker.cjs(readAccessibility,target.send), consistent with the main-process exit.The profile is clean enough to rule out basic state corruption:
~/.config/t3code/PreferencesandLocal Stateparse as valid JSON,declarative_performance_observer.dbreturnsPRAGMA integrity_check = ok, and there is no~/.config/t3code/SingletonLock. Existing backend listeners on127.0.0.1:3773and127.0.0.1:3774answer HTTP requests;3775is not listening/reachable.This still points at the main-process bundling change in
683aa870(first present in the.1700nightly): a lazy CJS chunk re-requiring./main.cjscan re-enter top-levelrunMainafter Electron is ready, producing theregisterSchemesAsPrivilegedfailure. The 1687 build predates that change and remains the working rollback.Additional repro from Ubuntu 26.04 (GNOME Shell, Wayland session, x64):
0.0.41-nightly.20260915.1735AppImage: exits with code 1 before any window appears. Log showsERROR (#160): Error: protocol.registerSchemesAsPrivileged should be called before app is readyatdist-electron/main.cjs:35862, dying right afterbootstrap backend start requested. Deterministic across runs, including with a fresh database.0.0.41-nightly.20260914.1687on the same machine and profile:backend ready+main window created, runs fine.
So this also hits GNOME, not just Hyprland/Niri — consistent with the portal-capture-mode trigger. 1735 still contains
require("./main.cjs")in the dbus-next chunk (verified via strings on the shipped app.asar).
What happened
The app is not launching after the latest update.
The Linux desktop app (Nightly AppImage) auto-updated from
0.0.41-nightly.20260914.1687to0.0.41-nightly.20260914.1700. Since then every launch exits with code 1 within about a second, before a window appears. Build 1687 still launches normally on the same machine with the same user data.Diagnosis
The desktop main bundle
main.cjsgets evaluated a second time after Electron is ready. The second evaluation runsprogram.pipe(Effect.provide(desktopRuntimeLayer), runMain)again. Its pre-ready layer (DesktopPreReadyPlatform.layer→ElectronProtocol.layerSchemePrivileges) callsprotocol.registerSchemesAsPrivileged, which throws after ready. That secondrunMainthen exits the process with code 1.Chain, taken from the packaged 1700
app.asarand aNODE_DEBUG=modulelaunch:portalcapture mode (Wayland/Hyprland here) and lazily loads./PortalCaptureShortcut-*.cjs.requires./dbus-next-*.cjsat top level.dbus-next-*.cjsdoesconst require_main = require("./main.cjs")at top level, to get the bundledsax(require_main.require_sax()).Module._load checking cache for …/dist-electron/main.cjs false: the entry, which was loaded as module".", is not a cache hit, so the whole entry bundle runs again. It shares the sameSchema-*.cjschunk, which is why the error comes from fiber#160.ERROR (#160): Error: protocol.registerSchemesAsPrivileged should be called before app is ready, and the process exits with code 1. The first runtime's logs keep going for a few ms, up tobootstrap backend start requested, then the process dies.Likely regression: #11410 (
683aa870 build(desktop): bundle the main process and stage only its native externals). It inlinesdbus-next,sax,effect, and others into the desktop bundle.app.asar/node_moduleswent from 136 entries in 1687 to 13 in 1700, and the bundler now hoistssaxinto the entry chunk, so a lazy chunk re-requires the entry. In 1687,dbus-nextwas an external package innode_modules, and startup does not fail. Nightly 1700 =01e05c15268d=mainat the time of triage, so no fix is available yet.This probably affects any Linux desktop where SnapShot uses portal capture mode. The trigger is the
mode === "portal"branch that lazily loadsPortalCaptureShortcut.Steps to reproduce
0.0.41-nightly.20260914.1700.registerSchemesAsPrivilegederror and exit code 1; no window appears.NODE_DEBUG=moduleand observedbus-next-*.cjsrequesting./main.cjsand missing the cache.Deterministic: 3/3 launches failed.
Version
0.0.41-nightly.20260914.1700 (t3codeCommitHash 01e05c1); last working 0.0.41-nightly.20260914.1687 (c07575f)
Environment
Arch Linux x64 (kernel 7.2.3-arch1-3), Hyprland 0.56.2 on Wayland; Nightly AppImage run from a persistent
--appimage-extractdirectory with--no-sandboxEvidence
Related issues
#11710 and #11523 are other bugs in the 0.0.41 nightlies (static asset serving from app.asar), not startup exits. #10911 is an intermittent silent exit on Hyprland in 0.0.38; this one is deterministic, has a clear error, and started with nightly 1700.
Fix applied or workaround
Launched the still-extracted previous build (1687) directly, which starts normally (
backend ready,main window created). No source changes. Downgrading to stable was avoided because of possible database migrations.Filed by
Claude Code (Claude Opus 5,
claude-opus-5[1m]) viat3 triage