[GH-ISSUE #8298] analyze-javascript-application stalls at javascript_worker_static on a 222 KB Vite + React 19 production bundle (Windows) #6532

Open
opened 2026-11-01 21:12:00 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @bstBizEra on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/8298

Version: rea-agents 6.8.0 (npm), via MCP (npx -y rea-agents@6.8.0 mcp) and via the CLI
OS: Windows 11 (10.0.26300.9711), Node v24.22.1

What happens

Running analyze-javascript-application on a small Vite production build never parses its one JavaScript file. Progress stops at the static pass and the analysis ends at its deadline with 0 syntax nodes visited.

  • MCP (analyze_javascript_application, default 300000 ms): returns partial Evidence and provider_timeout ("JavaScript source analysis reached its 300000ms per-source server/provider deadline"); parsed_javascript_files: 0, 1 skipped, coverage partial, 12 semantic unknowns.
  • CLI with --analysis-timeout-ms 120000: same stall, exit 1 with partial Evidence. Last progress lines:
{"rea_progress":{"phase":"parse_javascript_source", ... "Parsing and projecting assets/index-D5eaJq-h.js (1/2)"}}
{"rea_progress":{"phase":"javascript_worker_parse", ... "JavaScript worker parse: assets/index-D5eaJq-h.js"}}
{"rea_progress":{"phase":"javascript_worker_static", ... "JavaScript worker static: assets/index-D5eaJq-h.js"}}
  • CLI with --analysis-timeout-ms 900000: same stall for the full 15 minutes (15m 2.8s wall clock), exit 1, partial Evidence ev_aa3d26ff4f9b…, parsed_javascript_files: 0; no progress line after javascript_worker_static. So it never finishes rather than being slow.

Control

A hand-written 2-file app (one index.html, one 5-line app.js using localStorage, fetch, setTimeout) analyses in 3.5 s, exit 0, with all three relationships found. So the install and engine work; the stall is specific to this bundle.

The input

  • dist/assets/index-D5eaJq-h.js, 222,054 bytes, sha256 5bcc24d653ea2940d668da4bad7b4923d5cbbbe638e452e9a1035a10c2e135d5
  • Built by vite build (Vite 8.3.5, @vitejs/plugin-react 6.1.2) from a ~100-line React 19.3.1 todo app; no custom config. Happy to attach the bundle (it contains only React and the app code).

Steps

npm create vite@latest app -- --template react   # then a small component
npm run build
npx -y rea-agents@6.8.0 analyze-javascript-application <abs path>/dist --json --analysis-timeout-ms 120000

Expected

The bundle parses (or fails with a parse error) well within the deadline, and the Evidence lists the entry point and the localStorage use.

Originally created by @bstBizEra on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/8298 **Version:** `rea-agents` 6.8.0 (npm), via MCP (`npx -y rea-agents@6.8.0 mcp`) and via the CLI **OS:** Windows 11 (10.0.26300.9711), Node v24.22.1 ## What happens Running `analyze-javascript-application` on a small Vite production build never parses its one JavaScript file. Progress stops at the static pass and the analysis ends at its deadline with 0 syntax nodes visited. - **MCP** (`analyze_javascript_application`, default 300000 ms): returns partial Evidence and `provider_timeout` ("JavaScript source analysis reached its 300000ms per-source server/provider deadline"); `parsed_javascript_files: 0`, 1 skipped, coverage partial, 12 semantic unknowns. - **CLI** with `--analysis-timeout-ms 120000`: same stall, exit 1 with partial Evidence. Last progress lines: ``` {"rea_progress":{"phase":"parse_javascript_source", ... "Parsing and projecting assets/index-D5eaJq-h.js (1/2)"}} {"rea_progress":{"phase":"javascript_worker_parse", ... "JavaScript worker parse: assets/index-D5eaJq-h.js"}} {"rea_progress":{"phase":"javascript_worker_static", ... "JavaScript worker static: assets/index-D5eaJq-h.js"}} ``` - **CLI** with `--analysis-timeout-ms 900000`: same stall for the full 15 minutes (15m 2.8s wall clock), exit 1, partial Evidence `ev_aa3d26ff4f9b…`, `parsed_javascript_files: 0`; no progress line after `javascript_worker_static`. So it never finishes rather than being slow. ## Control A hand-written 2-file app (one `index.html`, one 5-line `app.js` using `localStorage`, `fetch`, `setTimeout`) analyses in 3.5 s, exit 0, with all three relationships found. So the install and engine work; the stall is specific to this bundle. ## The input - `dist/assets/index-D5eaJq-h.js`, 222,054 bytes, sha256 `5bcc24d653ea2940d668da4bad7b4923d5cbbbe638e452e9a1035a10c2e135d5` - Built by `vite build` (Vite 8.3.5, `@vitejs/plugin-react` 6.1.2) from a ~100-line React 19.3.1 todo app; no custom config. Happy to attach the bundle (it contains only React and the app code). ## Steps ``` npm create vite@latest app -- --template react # then a small component npm run build npx -y rea-agents@6.8.0 analyze-javascript-application <abs path>/dist --json --analysis-timeout-ms 120000 ``` ## Expected The bundle parses (or fails with a parse error) well within the deadline, and the Evidence lists the entry point and the `localStorage` use.
Author
Owner

@Plastic-time commented on GitHub (Nov 3, 2026):

Reproduced on main at c3647ade1 (Windows 11 x64, Node 24.22.1). This is not specific to Vite 8. All four inputs below end with parsed_javascript_files: 0 and "Owned JavaScript worker exhausted its 1024 MiB V8 old-space heap … during static":

  • react-dom's own cjs/react-dom-client.production.js, 19.2.7 and 19.3.1
  • a Vite 7.3.7 build of a 20-line React app
  • a Vite 8.3.5 build of the same app, with or without minification

On main the CLI now exits 0 after about 60 s with partial Evidence, instead of running into the deadline.

I ran only the static pass in-process (analyzeParsedJavaScriptStaticSourceSteps), on growing prefixes of react-dom-client.production.js 19.3.1:

  • Up to top-level statement 204, each prefix finishes in under 2.5 s.
  • From statement 205 on, each prefix runs past 40 s. Statement 205 is propagateContextChanges.
  • That 2.3 KB function alone takes 39 s and about 300 MiB.
  • A CPU profile puts 76 % of the samples under collectSemanticMemberMutationsSteps → markValue → markTarget → semanticProjectedSourceFactsAtRead.

This 1.3 KB reduction of that function still takes about 5 s and returns status: partial:

function propagateContextChanges(workInProgress, contexts, renderLanes, forcePropagateEntireTree) {
  var fiber = workInProgress.child;
  for (; null !== fiber; ) {
    var list = fiber.dependencies;
    if (null !== list) {
      var nextFiber = fiber.child;
    } else if (18 === fiber.tag) {
      nextFiber = fiber.return;
      nextFiber.lanes |= renderLanes;
      null !== list && (list.lanes |= renderLanes);
      nextFiber = null;
    } else
      13 === fiber.tag && null !== fiber.memoizedState && null === fiber.memoizedState.dehydrated
        ? ((fiber.lanes |= renderLanes),
          (nextFiber = fiber.alternate),
          null !== nextFiber && (nextFiber.lanes |= renderLanes),
          scheduleContextWorkOnParentPath(fiber.return, renderLanes, workInProgress),
          (nextFiber = fiber.child),
          (nextFiber = null !== nextFiber ? nextFiber.sibling : null))
        : (nextFiber = fiber.child);
    if (null !== nextFiber) nextFiber.return = fiber;
    else
      for (nextFiber = fiber; null !== nextFiber; ) {
        fiber = nextFiber.sibling;
        nextFiber = nextFiber.return;
      }
    fiber = nextFiber;
  }
}

Any one of these changes brings it under 0.3 s:

  • dropping the inner for (nextFiber = fiber; …) loop
  • dropping the nextFiber.return = fiber write
  • replacing the conditional with a plain nextFiber = fiber.child
<!-- gh-comment-id:6617331797 --> @Plastic-time commented on GitHub (Nov 3, 2026): Reproduced on `main` at `c3647ade1` (Windows 11 x64, Node 24.22.1). This is not specific to Vite 8. All four inputs below end with `parsed_javascript_files: 0` and "Owned JavaScript worker exhausted its 1024 MiB V8 old-space heap … during static": - react-dom's own `cjs/react-dom-client.production.js`, 19.2.7 and 19.3.1 - a Vite 7.3.7 build of a 20-line React app - a Vite 8.3.5 build of the same app, with or without minification On `main` the CLI now exits 0 after about 60 s with partial Evidence, instead of running into the deadline. I ran only the static pass in-process (`analyzeParsedJavaScriptStaticSourceSteps`), on growing prefixes of `react-dom-client.production.js` 19.3.1: - Up to top-level statement 204, each prefix finishes in under 2.5 s. - From statement 205 on, each prefix runs past 40 s. Statement 205 is `propagateContextChanges`. - That 2.3 KB function alone takes 39 s and about 300 MiB. - A CPU profile puts 76 % of the samples under `collectSemanticMemberMutationsSteps` → `markValue` → `markTarget` → `semanticProjectedSourceFactsAtRead`. This 1.3 KB reduction of that function still takes about 5 s and returns `status: partial`: ```js function propagateContextChanges(workInProgress, contexts, renderLanes, forcePropagateEntireTree) { var fiber = workInProgress.child; for (; null !== fiber; ) { var list = fiber.dependencies; if (null !== list) { var nextFiber = fiber.child; } else if (18 === fiber.tag) { nextFiber = fiber.return; nextFiber.lanes |= renderLanes; null !== list && (list.lanes |= renderLanes); nextFiber = null; } else 13 === fiber.tag && null !== fiber.memoizedState && null === fiber.memoizedState.dehydrated ? ((fiber.lanes |= renderLanes), (nextFiber = fiber.alternate), null !== nextFiber && (nextFiber.lanes |= renderLanes), scheduleContextWorkOnParentPath(fiber.return, renderLanes, workInProgress), (nextFiber = fiber.child), (nextFiber = null !== nextFiber ? nextFiber.sibling : null)) : (nextFiber = fiber.child); if (null !== nextFiber) nextFiber.return = fiber; else for (nextFiber = fiber; null !== nextFiber; ) { fiber = nextFiber.sibling; nextFiber = nextFiber.return; } fiber = nextFiber; } } ``` Any one of these changes brings it under 0.3 s: - dropping the inner `for (nextFiber = fiber; …)` loop - dropping the `nextFiber.return = fiber` write - replacing the conditional with a plain `nextFiber = fiber.child`
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#6532
No description provided.