Skip to content

[Bug]: macOS App fails to load #17792

Description

@aashishsingla567

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

Image T3 Code (Alpha) 0.0.45 Path: / Time: 2026-10-10T10:39:21.970Z

PrimaryEnvironmentRequestError
at e.fromCause (t3code://app/assets/primary-U1QeYewv.js:1:758)
at t3code://app/assets/primary-U1QeYewv.js:1:2137
at async Y (t3code://app/assets/primary-U1QeYewv.js:1:3163)
at async Q (t3code://app/assets/primary-U1QeYewv.js:1:3424)
at async Object.beforeLoad (t3code://app/assets/main-DPnH3f5B.js:35:33261)
at async Rh (t3code://app/assets/main-DPnH3f5B.js:2:29004)
at async t3code://app/assets/main-DPnH3f5B.js:2:48160

Caused by:
Error: Error invoking remote method 'desktop:get-local-environment-bearer-token': DesktopLocalEnvironmentAuthSessionBootstrapError: Failed to create the local desktop bearer session.

Expected behavior

App should work

Actual behavior

App did load

Impact

Minor bug or occasional failure

Version or commit

0.0.45 (6c8fed3)

Environment

macOS 26.6.1

Logs or stack traces

T3 Code (Alpha) 0.0.45
Path: /
Time: 2026-10-10T10:39:21.970Z

PrimaryEnvironmentRequestError
    at e.fromCause (t3code://app/assets/primary-U1QeYewv.js:1:758)
    at t3code://app/assets/primary-U1QeYewv.js:1:2137
    at async Y (t3code://app/assets/primary-U1QeYewv.js:1:3163)
    at async Q (t3code://app/assets/primary-U1QeYewv.js:1:3424)
    at async Object.beforeLoad (t3code://app/assets/main-DPnH3f5B.js:35:33261)
    at async Rh (t3code://app/assets/main-DPnH3f5B.js:2:29004)
    at async t3code://app/assets/main-DPnH3f5B.js:2:48160

Caused by:
Error: Error invoking remote method 'desktop:get-local-environment-bearer-token': DesktopLocalEnvironmentAuthSessionBootstrapError: Failed to create the local desktop bearer session.

Screenshots, recordings, or supporting files

No response

Workaround

reload

Activity

  1. added
    bugSomething is broken or behaving incorrectly.
    needs-triageIssue needs maintainer review and initial categorization.
    on Oct 10, 2026
  2. juliusmarminge commented on Oct 10, 2026

    @juliusmarminge
    Member

    Note

    Grok responding on behalf of Julius.

    Thanks for the report and the full stack trace.

    What happened: on launch, the desktop app swaps its bootstrap credential for a bearer session by calling the local backend's /oauth/token over loopback (apps/desktop/src/backend/DesktopLocalEnvironmentAuth.ts). If that single request fails, for example because the backend is still starting or the loopback connection is refused or reset, the error comes back as DesktopLocalEnvironmentAuthSessionBootstrapError, and the root beforeLoad shows it as PrimaryEnvironmentRequestError. The token isn't cached on failure, so reloading tries again, which is why reload fixed it.

    Status: in 0.0.45 (6c8fed35dded, released Oct 2) that exchange runs exactly once with no retry. Since then, #10298 (merged Oct 6, commit 365aa87) added a retry on main. Connection failures, timeouts, and 502/503/504 responses are now retried every 500 ms for up to 15 seconds. Rejected credentials and other server errors still fail immediately. This looks like the same transient failure as #12918, which was closed when that change landed.

    We haven't confirmed which error was underneath in your case, because the cause isn't shown in the stack. So this should be fixed in the next release, but that isn't certain yet. If it still happens on a build newer than 0.0.45, please reopen this and attach the desktop log from around launch so we can see the underlying cause.

    Related: #12918 (same error, transient loopback failure), #17367 / #17568 (Windows web-mode bootstrap failure that reload doesn't fix, so a different issue), #3513 (a beforeLoad error that stays until reload).

  3. added
    duplicateThis issue or pull request already exists
    via-triageFiled through npx t3 triage
    and removed
    needs-triageIssue needs maintainer review and initial categorization.
    on Oct 10, 2026
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

    bugSomething is broken or behaving incorrectly.duplicateThis issue or pull request already existsvia-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