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

Duplicate Route-Specific Client Chunk Requests During App Router Navigation With Turbopack

During client-side navigation in Next.js App Router with Turbopack, the same route-specific chunk is requested twice because the Turbopack chunk loader runtime and the App Router bootstrap/hydration runtime each independently load the chunk without a shared cache.

highConfidence 85%Next.jsPages RouterTurbopackApp RouterAffected V16.2.1-Canary.33

Origin Analysis

The Turbopack chunk loader runtime and the App Router bootstrap/hydration runtime maintain separate in-memory caches for loaded chunks. When the flight payload references a chunk during navigation, both runtimes attempt to load it, resulting in duplicate requests for the same chunk URL.
1. Clone https://github.com/gurkerl83/next-app-router-duplicate-chunk-nav-repro 2. Install dependencies with pnpm install 3. Build with pnpm build 4. Start production server with pnpm start 5. Open http://localhost:3000/ in browser 6. Open DevTools Network tab, enable Initiator column, disable cache, clear network log 7. Click 'Open Light Dashboard' 8. Observe same chunk requested twice 9. Go back, clear log, click 'Open Heavy Dashboard' 10. Observe duplicate requests for multiple chunks 11. Reload /heavy-dashboard directly; no duplicates

Fixing Code Block

Edge Case Audit

This change may cause stale chunk data if the same chunk URL is reused across builds or HMR updates without cache invalidation. It should be rolled back if it interferes with dynamic chunk replacement during development. Ensure the cache is cleared on new builds or when a chunk's content is updated to avoid serving outdated code.

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