Repository navigation
Description
Before submitting
- I searched the open and closed issues for a related report (alias-selections, alias selection bound, electron_call_paths_limited, Bitwarden). Related: fix(javascript): follow Electron through Webpack bootstrap externals #2948 and [Bug] Computed module-table slot write still reports replaced Electron BrowserWindow #3883 (Webpack externals and loader writes), [Bug] Destructuring Electron from a Webpack module-table external drops BrowserWindow and IPC (
const {BrowserWindow, ipcMain} = external_electron_) #4490 (destructuring, open), [Perf] Semantic member-mutation traversal takes 84 s and 1.2 GB on pdf.js's 462 KB openjpeg_nowasm_fallback.js #2498 (semantic traversal cost). None covers this bound. - I removed credentials, tokens, private paths, and sensitive target data.
Area
Evidence, artifacts, or reconstruction
Observed behavior
On Bitwarden desktop 2026.10.0, [email protected] reports fewer Electron facts for the Webpack main bundle than 6.7.0 did, on identical input and settings:
analyze-javascript-application app.asar --source-path main.js --source-path preload.js |
6.7.0 | 6.8.0 | main 19447516a |
|---|---|---|---|
browser_windows |
1 | 0 | 0 |
explicit_web_preferences |
7 | 0 | 0 |
ipc.operations |
145 | 112 | 112 |
ipc.main_handlers |
50 | 32 | 32 |
| literal main channels | 33 | 32 (ipc.log lost) |
32 |
All runs used NODE_OPTIONS=--max-old-space-size=5120, so the parent result budget isn't involved. Without it, 6.8.0 also reports "Expanded application relationships for main.js exceed the parent's result budget", which 6.7.0 didn't need.
The lost facts are ordinary Webpack member reads, for example in main.js:
const electron_1 = __webpack_require__(84157); // line 124396
electron_1.ipcMain.on(ipc_channels_1.AUTOTYPE_MVP_IPC_CHANNELS.TOGGLE, …) // line 124409, lost
this.win = new electron_1.BrowserWindow({ … }) // line 129766, lostOf 64 window and handler nodes on 6.7.0, 22 are missing on 6.8.0: 19 main handlers and the window in main.js, and 2 renderer handlers in preload.js. The result says why: semantic_resource_limits: ["alias-selections"], electron_call_paths_limited: true, and the limitation "Alias selection expansion was conservatively bounded (maximum 512 additional selector states); selected paths remain unknown."
The same shape in a small bundle is still resolved on 6.8.0. I checked a minimal Webpack bootstrap whose factory does const electron_1 = __webpack_require__(84157); electron_1.ipcMain.on(…); new electron_1.BrowserWindow(…), and it gives 1 window and 1 handler. So the loss comes from the bound on a large bundle, not the pattern.
Cause (source-derived on 6.8.0 and main 19447516a): canonicalWebpackInteropBindings in src/domain/javascript/javascriptBundledRequireOrigin.ts walks references to decide whether a write may select the Webpack loader. When the walk passes SEMANTIC_ALIAS_SELECTION_LIMIT (512), loaderMayOwnReference returns true, so the loader is treated as possibly overwritten and Electron identity through __webpack_require__ is withheld. Bitwarden's main.js is a 5 MB bootstrap with 1,153 modules, so the walk passes 512 even though the loader is never reassigned. main.js has no assignment to __webpack_require__ itself, only the standard bootstrap property definitions (.c .d .e .f .m .nmd .o .r .s .u .v, one each) and the bootstrap's single module-cache write. The check arrived in 6.8.0, with e9fc8fb, 5cbcd58 and 4394e8b touching this path.
Raising the bound isn't a workaround. As an experiment I set SEMANTIC_ALIAS_SELECTION_LIMIT to 1,048,576 locally: the worker exhausted a 4,096 MiB heap on main.js, and the result dropped to 0 main handlers.
Reproduction
Bitwarden-2026.10.0-amd64.debfrom https://github.com/bitwarden/clients/releases/tag/desktop-v2026.10.0, sha256fcabfc7da3c327e2625b105e951cee4e60703bb8e256f0aac9cc9bc83ec7063f(matches the GitHub asset digest).opt/Bitwarden/resources/app.asaris 71,317,476 bytes, and itsmain.jsis 5,042,030 bytes.
NODE_OPTIONS=--max-old-space-size=5120 rea analyze-javascript-application …/resources/app.asar \
--source-path main.js --source-path preload.js --format jsonLinux x64 container, Node 24.22.1; 6.7.0 and 6.8.0 from npm, main built from source.
Expected behavior
A bundle as large as Bitwarden's shouldn't lose Electron facts that 6.7.0 found, when nothing writes to the Webpack loader. Possible directions:
- Answer "does any write select the loader?" from the set of write sites rather than by walking references from every read. In Bitwarden, the only writes involving the loader are the standard bootstrap property definitions.
- Scope the bound per factory instead of per bootstrap.
- If a bound remains, report which modules lost Electron identity (a count or locations), so the summary isn't read as 0 windows.
Impact and scope
This affects any large Webpack-bundled Electron main process. Bitwarden is one real case, and its only window plus its webPreferences disappear from the summary. The limitation is disclosed, but the headline numbers changed between 6.7.0 and 6.8.0 without any change in the input. It also prevents verifying #4490's fix (PR #6993) on a real app: that PR passes all six minimal fixtures but can't show the Bitwarden channel while this bound fires.
Activity
fix(javascript): preserve loader identity across terminal origins (#9107
Davmunrey commentedon Nov 14, 2026
Re-tested on
mainat 4502bd4 (Linux x64, Node 24.22.1), same input as the report:Bitwarden-2026.10.0-amd64.deb, sha256fcabfc7d…7063f,app.asarsha2563f129eb2…446bb.Observed
rea analyze-javascript-application app.asar --source-path main.js --source-path preload.js --format json(default precision, 2m20s):browser_windowsexplicit_web_preferencesipc.operationsipc.main_handlersipc-handlerand 89ipc-channelnodes; the result carries "Conditional Electron findings are retained in the graph but excluded from proven boundary summary counts". No browser-window node is present.alias-selectionsat the default 512.--semantic-precision '{"alias_selections":200000}'the worker exhausts its 1024 MiB heap onmain.jsafter 34 s and the summary is still all zeros. So the remediation the limitation text suggests does not work for this input.Where the budget is hit
With a temporary trace on
valueResourceLimits.add(main.js only),canonicalWebpackInteropBindings/loaderMayOwnReferenceno longer records the limit, so the walk named in this issue appears addressed (3e0599a). The limit is now recorded from these callers instead:selectedRequireSourcesAt(viacreateRequireFactoryCallAt,semanticRequireCallAt, the intrinsic-invocation resolver)hasCommonJsModuleSource(viaisModuleObject,isCommonJsRequireDelegate)localPropertyMethodsinjavascriptSemanticMemberMutations(property reads and the.somepath)SemanticAliasSelections.onLimitinjavascriptSemanticReturnedReferencesenqueue/possiblePathinjavascriptElectronAppPathChanges(four call sites)Source-derived, not verified
Any single hit sets a file-wide
alias-selectionslimit, and a file with any semantic resource limit has all its Electron findings treated as conditional. On a 5 MB, 1,153-module bundle one over-budget query anywhere is therefore enough to zero the proven summary, independent of whether that query is related to the Electron call path.Not done
No fix attempted: which of these queries may safely stay local to the value they bound (instead of limiting the whole file) looks like a design decision for the maintainers. I did not measure 6.7.0 or 6.8.0 myself; those columns are from the report. Not tested with a larger
--max-heap-mb.fix(javascript): resolve merge conflict with main (morluto#7253)