[GH-ISSUE #861] analyze-javascript-application: unreadable_output '/label (too_small)' on a Vite bundle containing SheetJS (xlsx) #358

Closed
opened 2026-10-15 18:24:15 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @DariuszCiesielski on GitHub (Oct 7, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/861

Summary

analyze-javascript-application on a plain Vite/React production build (dist/, 2.9 MB, ~25 JS chunks) fails deterministically with:

"code": "unreadable_output", "reason": "Result schema rejected 1 issue at /label (too_small)"

The analysis completes (~16 s), but REA builds a graph node with an empty label and then rejects its own result against the output schema (min(1) on label). No partial output, no hint which file caused it.

Reproduction

  • npx -y rea-agents@4.1.0 analyze-javascript-application ./dist --artifact-format directory --format json
  • macOS (Apple Silicon), Node 25.6.1 (outside the supported range ^22.19 || ^24.11 || >=26 — noted; the failure looks logical, not version-dependent, but I could not verify on Node 22/24).
  • Target: Vite 5 build of a React SPA. Same result via MCP (rea-agents mcp wired into Codex CLI).

Bisection over the chunks (5 steps, running REA on subsets) isolates one file: a ~1 MB chunk that bundles SheetJS (xlsx). Remove that single chunk and the /label error disappears (the remaining large chunk then hits #623 instead). Any Vite project that imports xlsx should reproduce this; I cannot share the exact bundle (client code), but the offending content is the public xlsx library.

Expected

Either (a) the graph builder never emits an empty label (fallback like <anonymous> / unknown), or (b) the schema violation is reported with the file/node that produced it, so the user can exclude it, or (c) the result is returned with the offending node dropped and a warning — anything but a total failure on one third-party library.

Observed side note

On the 12 small chunks (312 KB) where analysis succeeds, the JSON result is 254 MB (~800× input), 50 968 nodes, 6 853 unknowns. A 4-line test file yields 106 KB. This makes the tool hard to use on ordinary web bundles even when it does not fail.

Originally created by @DariuszCiesielski on GitHub (Oct 7, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/861 ## Summary `analyze-javascript-application` on a plain Vite/React production build (`dist/`, 2.9 MB, ~25 JS chunks) fails deterministically with: ```json "code": "unreadable_output", "reason": "Result schema rejected 1 issue at /label (too_small)" ``` The analysis completes (~16 s), but REA builds a graph node with an **empty `label`** and then rejects its own result against the output schema (`min(1)` on `label`). No partial output, no hint which file caused it. ## Reproduction - `npx -y rea-agents@4.1.0 analyze-javascript-application ./dist --artifact-format directory --format json` - macOS (Apple Silicon), Node 25.6.1 (outside the supported range `^22.19 || ^24.11 || >=26` — noted; the failure looks logical, not version-dependent, but I could not verify on Node 22/24). - Target: Vite 5 build of a React SPA. Same result via MCP (`rea-agents mcp` wired into Codex CLI). Bisection over the chunks (5 steps, running REA on subsets) isolates **one file**: a ~1 MB chunk that bundles **SheetJS (`xlsx`)**. Remove that single chunk and the `/label` error disappears (the remaining large chunk then hits #623 instead). Any Vite project that imports `xlsx` should reproduce this; I cannot share the exact bundle (client code), but the offending content is the public `xlsx` library. ## Expected Either (a) the graph builder never emits an empty label (fallback like `<anonymous>` / `unknown`), or (b) the schema violation is reported with the file/node that produced it, so the user can exclude it, or (c) the result is returned with the offending node dropped and a warning — anything but a total failure on one third-party library. ## Observed side note On the 12 small chunks (312 KB) where analysis succeeds, the JSON result is **254 MB** (~800× input), 50 968 nodes, 6 853 `unknowns`. A 4-line test file yields 106 KB. This makes the tool hard to use on ordinary web bundles even when it does not fail.
bsakaguchi 2026-10-15 18:24:15 +00:00
Author
Owner

@kaoru0822-kitauji commented on GitHub (Oct 7, 2026):

This looks fixed on main by #839, which is not in a release yet. A single empty string literal, such as fetch("") or x.getItem(""), became an empty graph label and failed validation at /label. SheetJS has many such literals. main now shows that label as "" and keeps the exact empty value in the observation properties.

I checked with the public xlsx@0.18.5 package bundled by Vite (import * as XLSX from "xlsx"; window.XLSX = XLSX;, 425 KB chunk). main returns a schema-valid result with no /label error. That result is about 78M tokens, so the output-size side note (#623) is still open.

<!-- gh-comment-id:6033606576 --> @kaoru0822-kitauji commented on GitHub (Oct 7, 2026): This looks fixed on `main` by #839, which is not in a release yet. A single empty string literal, such as `fetch("")` or `x.getItem("")`, became an empty graph label and failed validation at `/label`. SheetJS has many such literals. `main` now shows that label as `""` and keeps the exact empty value in the observation properties. I checked with the public `xlsx@0.18.5` package bundled by Vite (`import * as XLSX from "xlsx"; window.XLSX = XLSX;`, 425 KB chunk). `main` returns a schema-valid result with no `/label` error. That result is about 78M tokens, so the output-size side note (#623) is still open.
Author
Owner

@kaoru0822-kitauji commented on GitHub (Oct 7, 2026):

Closing as fixed on main by #839, after 4.1.0, as confirmed above with a Vite-bundled xlsx@0.18.5 chunk. An empty string literal, such as fetch(""), gets the display label "". The exact empty value stays in the observation properties, so the result now passes schema validation at /label.

The output-size side note is tracked in #623. This fix ships in the next release (release PR #771).

<!-- gh-comment-id:6041904979 --> @kaoru0822-kitauji commented on GitHub (Oct 7, 2026): Closing as fixed on `main` by #839, after 4.1.0, as confirmed above with a Vite-bundled `xlsx@0.18.5` chunk. An empty string literal, such as `fetch("")`, gets the display label `""`. The exact empty value stays in the observation properties, so the result now passes schema validation at `/label`. The output-size side note is tracked in #623. This fix ships in the next release (release PR #771).
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#358
No description provided.