AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Flight Payload Repeats Full Chunk URL List For Every Client Module Reference Causing ~29% SSR HTML Overhead

Each client module reference in the flight payload serializes the entire chunk URL list of its chunk group. With Turbopack merging client modules into a shared chunk group, the same list is repeated for every reference, inflating SSR HTML by roughly 29% on real pages and growing quadratically with client references and chunk group size.

highConfidence 85%Next.jsTurbopackReact Server ComponentsApp RouterAffected V16.2.10Affected V16.3.0-Canary.79

Origin Analysis

The Turbopack flight serializer emits the complete chunk URL array inline for every `I[...]` client module reference without deduplication. Since Turbopack assigns all client modules on a page to the same chunk group, every row carries an identical copy of the same URL list, causing payload size to scale as (number of client references) × (chunk group size).
1. `npm install`; 2. `npm run build` with Turbopack; 3. `npm run start`; 4. `node analyze.mjs http://localhost:3000/` which decodes `self.__next_f` and counts duplicate chunk URLs (minimal repro yields 117 chunk-URL strings, only 5 unique).

Fixing Code Block

Edge Case Audit

This is a breaking change to the internal flight protocol. Both server and client must be updated in lockstep; otherwise hydration will fail or references will resolve incorrectly. The new `J` row and reference-by-id semantics are not backward compatible with older Next.js clients. Rolling back requires reverting both serialization and parsing. Multi-version deployments (e.g., canary and stable mixed) must be avoided. Concurrent requests sharing the serializer instance can cause race conditions if the registry is not scoped per request; ensure each request has its own serializer instance. Also, dictionary entries must be ordered deterministically and emitted before any referencing row to avoid parse errors.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state