Skip to content

Desktop exits on launch in nightly 1700: dbus-next chunk re-requires main.cjs, registerSchemesAsPrivileged throws after ready #11720

Description

@goggi

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.1687 to 0.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.cjs gets evaluated a second time after Electron is ready. The second evaluation runs program.pipe(Effect.provide(desktopRuntimeLayer), runMain) again. Its pre-ready layer (DesktopPreReadyPlatform.layerElectronProtocol.layerSchemePrivileges) calls protocol.registerSchemesAsPrivileged, which throws after ready. That second runMain then exits the process with code 1.

Chain, taken from the packaged 1700 app.asar and a NODE_DEBUG=module launch:

  1. During bootstrap, SnapShot runs in portal capture mode (Wayland/Hyprland here) and lazily loads ./PortalCaptureShortcut-*.cjs.
  2. That chunk requires ./dbus-next-*.cjs at top level.
  3. dbus-next-*.cjs does const require_main = require("./main.cjs") at top level, to get the bundled sax (require_main.require_sax()).
  4. 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 same Schema-*.cjs chunk, which is why the error comes from fiber #160.
  5. 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 to bootstrap backend start requested, then the process dies.

Likely regression: #11410 (683aa870 build(desktop): bundle the main process and stage only its native externals). It inlines dbus-next, sax, effect, and others into the desktop bundle. app.asar/node_modules went from 136 entries in 1687 to 13 in 1700, and the bundler now hoists sax into the entry chunk, so a lazy chunk re-requires the entry. In 1687, dbus-next was an external package in node_modules, and startup does not fail. Nightly 1700 = 01e05c15268d = main at 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 loads PortalCaptureShortcut.

Steps to reproduce

  1. On Linux Wayland (Hyprland 0.56.2 here), with SnapShot using portal capture mode, install/update to T3 Code Nightly 0.0.41-nightly.20260914.1700.
  2. Launch the app from a terminal.
  3. Observe the registerSchemesAsPrivileged error and exit code 1; no window appears.
  4. Optional: launch with NODE_DEBUG=module and observe dbus-next-*.cjs requesting ./main.cjs and 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-extract directory with --no-sandbox

Evidence

[11:21:55.913] INFO (#3): app ready
[11:21:55.937] INFO (#3): bootstrap start
[11:21:55.949] INFO (#3): bootstrap ipc handlers registered
MODULE: Module._load REQUEST ./PortalCaptureShortcut-i8VbHw7e.cjs parent: .
MODULE: Module._load REQUEST ./dbus-next-DDJh0A1P.cjs parent: …/dist-electron/PortalCaptureShortcut-i8VbHw7e.cjs
MODULE: Module._load REQUEST ./main.cjs parent: …/dist-electron/dbus-next-DDJh0A1P.cjs
MODULE: Module._load checking cache for …/resources/app.asar/apps/desktop/dist-electron/main.cjs false
MODULE: load "…/resources/app.asar/apps/desktop/dist-electron/main.cjs" for module "…/dist-electron/dbus-next-DDJh0A1P.cjs"
[11:21:55.988] ERROR (#160): Error: protocol.registerSchemesAsPrivileged should be called before app is ready
    at desktop.electron.protocol.registerSchemePrivileges (…/resources/app.asar/apps/desktop/dist-electron/main.cjs:34390:118)
[11:21:56.003] INFO (#3): bootstrap backend start requested
# process exits with code 1

# dist-electron/dbus-next-DDJh0A1P.cjs (1700)
const require_rolldown_runtime = require("./rolldown-runtime-fg3euq-1.cjs");
const require_main = require("./main.cjs");
...
sax = require_main.require_sax();

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]) via t3 triage

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedfeature request acceptedbugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions