Skip to content

macOS app 26.908.31748: blank window when online — renderer throws "r is not a function" (authed-route ↔ app-primary circular import) #44743

Closed

Description

@scosmiclia

What version of the Codex App are you using (From "About Codex" dialog)?

26.908.31748 (bundled codex-cli 0.154.0-alpha.6.1). Rolling back to 26.901.51231 (codex-cli 0.153.4) fixes it.

What subscription do you have?

ChatGPT subscription (signed in with ChatGPT account)

What platform is your computer?

Darwin 24.3.0 arm64 arm (macOS 15.3.1, Apple M4)

What issue are you seeing?

After updating to 26.908.31748 the app opens to a blank main window and, after a while, no window at all. The main process and renderer keep running (no crashpad dump). The desktop log shows the renderer failing at first paint and then hitting the React error boundary:

warning [electron-message-handler] Initial route prefetch failed; rendering will retry errorMessage="r is not a function" errorName=Error errorStack="Error: r is not a function" route=primary windowType=electron
error   [electron-message-handler] error boundary componentStack="
    at Lazy (<anonymous>)
    at o (app://-/assets/app-initial-c932b6b5121b.js:8057:59005)
    at q7t (app://-/assets/app-initial-c932b6b5121b.js:1797:3233)
    at ob (app://-/assets/app-initial-c932b6b5121b.js:1797:8149)
    at n7a (app://-/assets/app-initial-c932b6b5121b.js:8057:93512)
    at W7a (app://-/assets/app-initial-c932b6b5121b.js:8057:104285)
    ..." errorMessage="r is not a function"

The interesting part: it only happens when the app can actually reach OpenAI. With no network (or a dead proxy) the same build renders fine. 26.901.51231 renders fine with identical flags.

What steps can reproduce the bug?

Launched via open -na /Applications/ChatGPT.app --args <flags> and read ~/Library/Logs/com.openai.codex/<date>/codex-desktop-*.log:

Build Flags Network Result
26.908.31748 --proxy-server=socks5://127.0.0.1:7890 (working proxy) reachable blank window, r is not a function + error boundary, 3/3 launches
26.908.31748 --proxy-server=http://127.0.0.1:7890 (working proxy) reachable same, 1/1
26.908.31748 --proxy-server=socks5://127.0.0.1:1 (dead port) unreachable window renders, no error
26.908.31748 no flags (system proxy off) unreachable window renders, no error
26.901.51231 --proxy-server=socks5://127.0.0.1:7890 reachable works

So it is not a proxy/networking bug; network reachability only changes the timing of what the renderer loads at startup.

What is the expected behavior?

The main window renders the app after login, as in 26.901.51231.

Additional information

I unpacked app.asar from both builds and compared the renderer chunks. This looks like a circular-import evaluation-order race introduced in 26.908:

  • In 26.901, authed-route-99252ed1daca.js was a one-liner: import{Gs as e,Ws as t}from"./app-primary-…";e();export{t as AuthedRoute}; and only app-initial referenced it (dynamically).
  • In 26.908, authed-route-86740a2af5a2.js grew to 1.7 KB (it now registers a smartphone-light-16 icon), imports {Dc, Oc, kc} from app-primary-68af4c0f2334.js and calls kc() (renamed to r in the chunk) at module-evaluation time.
  • New in 26.908: app-primary-68af4c0f2334.js also statically imports authed-route-86740a2af5a2.js, so the two chunks form a cycle. kc resolves to var azn = t(()=>{…}) inside app-primary, i.e. it is only assigned while app-primary's body executes.
  • ~300 other chunks statically import app-primary. If any of them is evaluated before the authed-route prefetch in app-initial (async function b8a(){await Promise.all([x8a.prefetch(),S8a.prefetch()])}), ESM evaluates app-primary first, its static dep authed-route runs before app-primary's body finishes, r is still undefined, and the renderer throws r is not a function. When the entry happens to be authed-route itself the cycle evaluates in the safe order, which is presumably why offline launches survive.

Breaking the cycle (app-primary should not statically import the route chunk, or the route chunk should not call into app-primary at eval time) should fix it. Happy to share full logs.

Activity

  1. added
    bug
    app
    on Sep 11, 2026
  2. hearwish commented on Sep 11, 2026

    @hearwish

    Image Is this the same question?

  3. scosmiclia commented on Sep 11, 2026

    @scosmiclia
    Author

    Image Is this the same question?

    yeah

  4. Flock-YT commented on Sep 11, 2026

    @Flock-YT

    I have same problem.

    Image
  5. knappy214 commented on Sep 11, 2026

    @knappy214

    Additional macOS reproduction with controlled rollback evidence for 26.908.31748.

    I independently reproduced the same renderer signature:

    Initial route prefetch failed; rendering will retry
    errorMessage="r is not a function"
    

    followed by:

    error boundary
    errorMessage="r is not a function"
    name=AppRoutes
    

    The local app-server remained healthy during the failure: initialization completed, auth/config/model calls succeeded, and the sidecar reached running.

    Isolation performed

    The failure still reproduced after each of the following:

    • plugins disabled
    • stale managed Remote SSH state removed; selected host local; no managed remotes remaining
    • Electron renderer cache / local-storage related state moved aside and regenerated
    • a completely new .codex-global-state.json generated by the app (Selected host: None, 17 top-level keys)
    • same account, database, MCP configuration, projects and network environment retained

    The fresh global-state test is especially useful: the app opened once, then failed again on the first retry.

    Controlled rollback

    Affected build:

    26.908.31748
    bundled app-server: 0.154.0-alpha.6.1
    

    Rolled back to the previous OpenAI-signed build:

    26.903.71938
    

    The historical arm64 package was downloaded directly from persistent.oaistatic.com; SHA-256 matched the published historical cask record:

    5c5e2fd554d5d806b31723ad413a60d11ef364b5d479dba3f30e6472daca0e19
    

    codesign --verify --deep --strict passed, Gatekeeper reported accepted / source=Notarized Developer ID, and TeamIdentifier matched the newer build (2DC432GLL2).

    A/B launch results

    • 26.903.71938 + fresh global state: 10/10 successful launches
    • restored original global state (only stale SSH remote removed): 3/3 successful launches
    • plugins re-enabled on 26.903.71938: 3/3 successful launches

    By contrast, 26.908.31748 failed intermittently within the first few relaunches and consistently produced the r is not a function / AppRoutes signature when it failed.

    This strongly supports a regression in the 26.908 renderer bundle, rather than user state, plugins, Remote SSH, MCP/Composio, SQLite, authentication, or the app-server.

    The circular-import / module-evaluation-order analysis in #44720 is highly consistent with the intermittent behavior observed here.

    I can provide sanitized logs if maintainers need a specific launch trace.

  6. Andrewlawn commented on Sep 11, 2026

    @Andrewlawn

    Additional macOS reproduction of the avatarOverlay AppRoutes crash on 26.908.31748 (build 8720), matching the Pet/avatarOverlay isolation reported in #44809 and the network-timing dependence in #44743.

    Environment

    • macOS 15.x (Darwin 25.6.0), Apple M5, arm64
    • ChatGPT/Codex Desktop 26.908.31748 (CFBundleVersion 8720), bundled codex-cli 0.154.0
    • ChatGPT subscription (ChatGPT auth)

    Sequence observed (desktop log, 2026-09-11)

    1. Earlier session had an invalidated OAuth refresh token (refresh_token_invalidated → "Your session has ended. Please log in again."). Fixed by codex login; API calls return 200 afterward.
    2. Relaunch with new token: avatarOverlay renderer mounts, then React error boundary:
    error [electron-message-handler] error boundary
    errorMessage="r is not a function"
    errorName=Error
    name=AppRoutes
    rendererWindowAppearance=avatarOverlay
    rendererWindowId=2
    
    1. The crashed overlay window cannot be closed (no AXCloseButton reachable via accessibility, Cmd+W ignored) and is restored offscreen/oversized (pos x=1084 y=-218, size 772×1867) on every relaunch.
    2. Decisive workaround, same as [macOS][26.908.31748] Enabling Pet causes “r is not a function” AppRoutes crash; disabling Pet fixes startup #44809: persisted state ~/.codex/.codex-global-state.json → electron-avatar-overlay-open: true re-opens the crashing overlay every startup. Setting it to false and relaunching removes the broken window entirely; the primary window works normally (no error boundary recurrence over 30+ min, model calls healthy).

    Extra detail that may help triage

    • remote_connections.connection_state_changed right before the boundary: connection-failed from failed to refresh available models — at 13:14 it was timeout waiting for child process to exit (transient); after the fix, models refresh succeeds, yet the overlay renderer still crashes deterministically when it mounts. So the crash is in the overlay AppRoutes render path itself, not downstream of the models fetch.
    • Concurrent bundled_plugins reconcile of openai-primary-runtime bundleVersion 26.904.11930 (installed Sep 5) + openai-bundled marketplace; the plugin sites install fails with plugin 'sites' was not found in marketplace 'openai-bundled' (separate warning, present in sessions before and after the crash).
    • With electron-avatar-overlay-open=false the overlay still mounts hidden and hits the same boundary exactly once at startup, then stops. No EPIPE / app-server unavailability here — local app-server stayed healthy throughout (unlike [macOS][26.908.31748] Enabling Pet causes “r is not a function” AppRoutes crash; disabling Pet fixes startup #44809's secondary errors).

    Happy to pull additional log lines if useful.

  7. badandyomega commented on Sep 11, 2026

    @badandyomega

    Adding a Windows reproduction of the same primary-window startup failure, with isolated-profile/configuration observations.

    Environment

    • Windows x64, version 25H2, OS build 26200.9445.
    • Windows package: OpenAI.Codex 26.908.3777.0.
    • Embedded desktop app version: 26.908.31457 (read from the installed package).
    • Observed on September 11, 2026.

    Failure

    Opening the normal app shows “ChatGPT hit a snag” / “Something went wrong. Try again to continue.” Try again does not recover; Update ChatGPT reports that the installed version is current.

    Across three normal launches, the logs record:

    Initial route prefetch failed; rendering will retry
    errorMessage="r is not a function"
    route=primary
    rendererWindowAppearance=primary
    

    followed by the interface error boundary with the same error. The local app-server connected before the interface failed.

    A separate instance with fresh browser storage also logged:

    TypeError: r is not a function
    source: app://-/assets/app-initial-5efcb2fc7e21.js:6182
    

    That source location is the console reporting location, not a debugger-captured originating stack.

    Isolated reproduction observations

    Each configuration variant used a separate temporary CODEX_HOME, a fresh --user-data-dir, and CODEX_ELECTRON_USER_DATA_PATH set to that browser directory. These were child-process environment overrides, with the working directory also inside the temporary test directory. No original authentication file, sessions, global state, or browser data was copied.

    Temporary configuration Matching TypeError observed
    Empty configuration No during the observation window
    Copy of original config.toml Yes
    Project trust section only Yes
    Hook trust section only Yes
    Original configuration excluding projects and hooks No during the observation window
    Minimal project entry below Yes, approximately six seconds after launch

    The smallest project configuration used in a failing clean-home launch was:

    [projects."C:/diagnostic-project"]
    trust_level = "untrusted"

    This is documented configuration syntax. To repeat that test, place only those two lines in a new temporary home's config.toml, launch the installed ChatGPT.exe with the isolated paths described above, and observe its Chromium console log. No sign-in credentials were copied.

    These are observed outcomes, not proof that project/hook settings are the root cause. Most variants were tested for one launch, and one initially clean hook test later logged the same error. Configuration changes could affect timing or module evaluation order, consistent with the race discussed here and in #44777. A no-error observation is not a verified fix or evidence that signed-in workflows succeed.

    Additional checks

    • Windows reports the installed package status as Ok.
    • 7,169 packaged JavaScript files matched their embedded ASAR SHA-256 hashes, with zero mismatches. This is an integrity comparison against the installed archive, not independent publisher verification.
    • The original profile and trust settings were preserved. No rollback or installed-code patch was tested.
    • This report was prepared with an assistant from local diagnostics. Only selected technical details and a synthetic config example are included; no raw logs, credentials, account identifiers, chat contents, or real workspace paths are attached.
  8. aaamosh commented on Sep 11, 2026

    @aaamosh

    Independent Linux reproduction, plus a narrower bundle-level root cause.

    I tested the official OpenAI amd64 .deb packages and compared pristine app.asar contents across the last working and affected builds.

    Runtime A/B, using the same existing profile and environment:

    • 26.903.61454 — starts normally; authenticated route loads successfully.
    • 26.908.31748 — reproduces Initial route prefetch failed / TypeError: n is not a function.
    • 26.908.40401 — reproduces the same failure.

    I also reinstalled the affected package from the cached official .deb and launched it with a pristine, unmodified app.asar, bypassing our local runtime-policy patch. The failure remained, so the local patch and profile can be excluded.

    The interesting new detail is the bundle dependency graph.

    In 26.903.61454:

    authed-route-9b121b4f652e.js
    → statically imports
    app-primary-1253798d8a4b.js

    but app-primary has no static import back to authed-route.

    The route chunk is only 88 bytes:

    import{oc as e,sc as t}from"./app-primary-1253798d8a4b.js";t();export{e as AuthedRoute};

    In 26.908.40401:

    authed-route-95b7e7dbb938.js
    → statically imports
    app-primary-124c64e4a755.js

    and app-primary-124c64e4a755.js
    → now also statically imports
    authed-route-95b7e7dbb938.js

    So the dependency became bidirectional.

    The same bidirectional edge is present in Linux 26.908.31748.

    I traced the new reverse edge further. In 26.908.40401, app-primary imports:

    {n as yZe,t as bZe} from "./authed-route-95b7e7dbb938.js"

    yZe is then used as leftIconAsset for the sidebar Help items:

    • Set up mobile
    • Set up remote

    and bZe() is called as part of app-primary initialization.

    Meanwhile, authed-route imports route/initializer symbols from app-primary and performs an evaluation-time call before exporting:

    n();export{r as AppLayoutRoute,t as AuthedRoute,o as n,s as t};

    So 26.908 appears to have moved/generated the smartphone-light-16 icon module into the lazy authed-route chunk, while app-primary itself needs that icon for the sidebar. That creates:

    app-primary -> authed-route -> app-primary

    with an initializer call occurring before the cycle is necessarily fully initialized.

    This is consistent with the observed n is not a function / r is not a function failures and with the evaluation-order hypothesis already described in this issue.

    A focused fix would likely be to keep the smartphone icon/initializer in a neutral shared/icon module rather than in authed-route, or otherwise ensure that app-primary never statically imports its lazy route chunk.

    Two regression checks also seem worthwhile:

    1. A build-time chunk-graph invariant preventing a primary application chunk and one of its lazy route chunks from statically importing each other.
    2. An authenticated-online desktop startup smoke test that performs the initial route prefetch and verifies the primary route renders.

    The Linux apt repository is still currently offering 26.908.40401 as the candidate version, so this remains user-impacting rather than only historical.

    I have not opened a PR because the repository contribution guide says external code contributions are invitation-only. If this diagnosis matches the team's intended direction and the relevant Desktop frontend source can be made available to an invited contributor, I'd be happy to prepare a focused fix and regression coverage.

  9. Ethan2424352 commented on Sep 12, 2026

    @Ethan2424352

    Additional Ubuntu reproduction and a rollback compatibility caveat, observed September 11–12, 2026.

    Environment: Ubuntu 26.04.1 LTS, Linux 7.0.0-31-generic, x86_64, GNOME Wayland/Xwayland, AMD Navi 10 with Mesa 26.2.2. Official OpenAI Debian packages.

    Verified results using the existing signed-in profile:

    Desktop package Result
    26.908.40401 Primary window shows “ChatGPT hit a snag”; TypeError: n is not a function.
    26.908.31748 Same failure after rollback.
    26.901.20858 Signed-in home screen and recent chats render, but GPT-6 Astra cannot be used.

    On 26.908.40401, debugger inspection captured:

    TypeError: n is not a function
        at app://-/assets/authed-route-95b7e7dbb938.js:1:1573
    

    At the failing module-evaluation call, typeof n was undefined. The same startup failure reproduced with a separate temporary XDG cache and --disable-gpu. dpkg -V chatgpt found no package-file discrepancies. No installed application code was patched.

    Rollback is not a complete workaround for this account/model: 26.901.20858 bundles codex-cli 0.153.0-alpha.5. Opening/using a GPT-6 Astra conversation displays:

    The 'gpt-6-astra' model requires a newer version of Codex. Please upgrade to the latest app or CLI and try again.

    The separately installed CLI reports 0.154.0, but that does not update the older desktop's bundled CLI. A rendered home screen therefore did not establish usable model access; our initial local verification missed this and was corrected by the user's follow-up screenshot.

    I have seen the maintainer's “Fixed” update on #44785 and the subsequent report naming 26.908.40834. That build has not yet been tested on this machine at the time of this comment. Posting these results to document the affected Linux builds and the model-compatibility limitation of rolling back too far, rather than opening another duplicate startup-crash issue.

    This report was prepared with an assistant from local diagnostics. Only selected technical details are included; no raw logs, screenshots, credentials, account identifiers, or conversation contents are attached.

    Update: verified on 26.908.40834

    After refreshing only the official OpenAI APT repository metadata, 26.908.40834 became available and was installed. The existing profile and authentication were retained.

    • The desktop now renders the signed-in conversation interface normally.
    • No matching startup TypeError or error-boundary entry appeared in the verification launch log.
    • dpkg -V chatgpt reports no discrepancies.
    • The bundled runtime is codex-cli 0.154.0-alpha.6.2. A minimal, ephemeral GPT-6 Astra request through that exact bundled executable returned OK, without the newer-client requirement error. This was a runtime/model connectivity test, not an automated GUI send test.

    This confirms the new release resolves the observed startup failure and the older rollback's model-version blocker in this environment. No long-duration or suspend/resume stability claim is made.

  10. yuzhu-oai commented on Sep 14, 2026

    @yuzhu-oai
    Contributor

    This has been fixed. Please update to the latest version.

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

    appbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions