[GH-ISSUE #1802] [Bug] Electron analysis reports 0 BrowserWindows and 0 preloads when main uses electron.BrowserWindow namespace form; miss is not logged as unknown #605

Closed
opened 2026-10-15 18:26:33 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @Nelglor on GitHub (Oct 11, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/1802

Note

🤖 Claude Fable 5.1 responding on behalf of Nick

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

javascript / Electron application analysis

Observed behavior

analyze-javascript-application reports browser_windows: 0 and preload_entrypoints: 0 for an Electron app whose bundled main process constructs new electron.BrowserWindow(...) four times. The miss is silent: nothing in semantic_graph.unknowns mentions BrowserWindow. The rest of the Electron summary for the same app is accurate (4 context-bridge APIs with a 121-member list that matches the source, native addon inventory, sender-frame validation, no utility processes).

Reproduction

  1. Target: T3 Code desktop (open source, https://github.com/pingdotgg/t3code), Linux AppImage nightly 0.0.46. Extract with --appimage-extract, then point REA at resources/app.asar.
  2. npx -y rea-agents@6.4.0 analyze-javascript-application /path/app.asar --format json
  3. summary.browser_windows is 0, summary.preload_entrypoints is 0.
  4. Compare with the bundle:
$ grep -oE 'new [A-Za-z_$.]*BrowserWindow\(' apps/desktop/dist-electron/main.cjs | sort | uniq -c
      4 new electron.BrowserWindow(
$ grep -oE 'require\("electron"\)' apps/desktop/dist-electron/main.cjs | head -1
require("electron")
$ grep -oE 'preload: ?[^,}]{0,60}' apps/desktop/dist-electron/main.cjs | sort -u
preload: environment.preloadPath
preload: pictureInPicturePreloadPath
preload: webPreferences?.preload ?? null

Expected behavior

The four BrowserWindow constructions are reported, and webPreferences.preload assignments whose value is a non-literal expression are surfaced either as preload entrypoints with an unresolved path or as explicit unknowns.

Impact and scope

Any Electron app whose main bundle keeps electron as a namespace object (const electron = require("electron"), which is what Rolldown/esbuild emit for import * as electron or CJS interop) gets zero windows and zero preloads in the summary. That is a large share of production bundles. Because the miss is not recorded as an unknown, an agent reading the summary will conclude the app opens no windows.

REA version

rea-agents 6.4.0 (npx)

Runtime and platform

Node 26.10.0; Linux x86_64 (CachyOS)

Target and artifact context

Electron asar, Linux x64 build; 3,225 parsed JavaScript files, 0 parse failures, 13.9M AST nodes; main entry correctly resolved to apps/desktop/dist-electron/boot.cjs

Interface

CLI (rea analyze-javascript-application)

Earliest failure stage

Electron boundary reconstruction (the summary.browser_windows / preload_entrypoints projection); inventory and module graph stages succeed.

Relevant output or evidence

"summary": {
  "browser_windows": 0,
  "explicit_web_preferences": 0,
  "preload_entrypoints": 0,
  "context_bridge_apis": 4,
  "exposed_api_members": 122,
  "ipc": {"operations": 144, "literal_channels": 1, "dynamic_channel_operations": 142, ...},
  "sender_validation_observations": 17,
  "utility_processes": 0,
  "native_addon_bindings": 0
}

Contrast with the four new electron.BrowserWindow( matches above.

Typed outcome or recovery expected

browser_windows ≥ 4 with their call-site anchors, or an explicit unknown of the form "BrowserWindow constructed through a namespace member expression, not resolved".

Analysis or suspected cause

The window detector appears to match only a bare BrowserWindow identifier (destructured const { BrowserWindow } = require("electron")) and not the member-expression form electron.BrowserWindow where electron is bound to require("electron"). Same shape for the preload: property: the three assignments above are non-literal expressions and are dropped rather than recorded.

Additional context

Minor noise seen in the same run, not filed separately: 6 of the 7 electron-renderer nodes are playwright-core's trace-viewer HTML pages under node_modules, and 45k of the unknowns are resource-limit entries on Vite asset chunks. The one real renderer (apps/server/dist/client/index.html) was found.

Originally created by @Nelglor on GitHub (Oct 11, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/1802 > [!NOTE] > 🤖 **Claude Fable 5.1 responding on behalf of Nick** ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area javascript / Electron application analysis ### Observed behavior `analyze-javascript-application` reports `browser_windows: 0` and `preload_entrypoints: 0` for an Electron app whose bundled main process constructs `new electron.BrowserWindow(...)` four times. The miss is silent: nothing in `semantic_graph.unknowns` mentions `BrowserWindow`. The rest of the Electron summary for the same app is accurate (4 context-bridge APIs with a 121-member list that matches the source, native addon inventory, sender-frame validation, no utility processes). ### Reproduction 1. Target: T3 Code desktop (open source, https://github.com/pingdotgg/t3code), Linux AppImage nightly 0.0.46. Extract with `--appimage-extract`, then point REA at `resources/app.asar`. 2. `npx -y rea-agents@6.4.0 analyze-javascript-application /path/app.asar --format json` 3. `summary.browser_windows` is `0`, `summary.preload_entrypoints` is `0`. 4. Compare with the bundle: ``` $ grep -oE 'new [A-Za-z_$.]*BrowserWindow\(' apps/desktop/dist-electron/main.cjs | sort | uniq -c 4 new electron.BrowserWindow( $ grep -oE 'require\("electron"\)' apps/desktop/dist-electron/main.cjs | head -1 require("electron") $ grep -oE 'preload: ?[^,}]{0,60}' apps/desktop/dist-electron/main.cjs | sort -u preload: environment.preloadPath preload: pictureInPicturePreloadPath preload: webPreferences?.preload ?? null ``` ### Expected behavior The four `BrowserWindow` constructions are reported, and `webPreferences.preload` assignments whose value is a non-literal expression are surfaced either as preload entrypoints with an unresolved path or as explicit unknowns. ### Impact and scope Any Electron app whose main bundle keeps `electron` as a namespace object (`const electron = require("electron")`, which is what Rolldown/esbuild emit for `import * as electron` or CJS interop) gets zero windows and zero preloads in the summary. That is a large share of production bundles. Because the miss is not recorded as an unknown, an agent reading the summary will conclude the app opens no windows. ### REA version rea-agents 6.4.0 (npx) ### Runtime and platform Node 26.10.0; Linux x86_64 (CachyOS) ### Target and artifact context Electron asar, Linux x64 build; 3,225 parsed JavaScript files, 0 parse failures, 13.9M AST nodes; main entry correctly resolved to `apps/desktop/dist-electron/boot.cjs` ### Interface CLI (`rea analyze-javascript-application`) ### Earliest failure stage Electron boundary reconstruction (the `summary.browser_windows` / `preload_entrypoints` projection); inventory and module graph stages succeed. ### Relevant output or evidence ``` "summary": { "browser_windows": 0, "explicit_web_preferences": 0, "preload_entrypoints": 0, "context_bridge_apis": 4, "exposed_api_members": 122, "ipc": {"operations": 144, "literal_channels": 1, "dynamic_channel_operations": 142, ...}, "sender_validation_observations": 17, "utility_processes": 0, "native_addon_bindings": 0 } ``` Contrast with the four `new electron.BrowserWindow(` matches above. ### Typed outcome or recovery expected `browser_windows` ≥ 4 with their call-site anchors, or an explicit unknown of the form "BrowserWindow constructed through a namespace member expression, not resolved". ### Analysis or suspected cause The window detector appears to match only a bare `BrowserWindow` identifier (destructured `const { BrowserWindow } = require("electron")`) and not the member-expression form `electron.BrowserWindow` where `electron` is bound to `require("electron")`. Same shape for the `preload:` property: the three assignments above are non-literal expressions and are dropped rather than recorded. ### Additional context Minor noise seen in the same run, not filed separately: 6 of the 7 `electron-renderer` nodes are playwright-core's trace-viewer HTML pages under `node_modules`, and 45k of the unknowns are `resource-limit` entries on Vite asset chunks. The one real renderer (`apps/server/dist/client/index.html`) was found.
bsakaguchi 2026-10-15 18:26:33 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#605
No description provided.