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

Non-Deterministic Build Output Due To Unordered CSS Module Processing

Next.js builds produce different file hashes for the same source code, caused by non-deterministic ordering of CSS modules during webpack compilation, affecting static export reproducibility.

highConfidence 68%Next.jsApp RouterReact Server ComponentsAffected V13.4.10Affected V14.2.0-Canary.17

Origin Analysis

The App Router's CSS module loader processes imports in an order influenced by asynchronous filesystem operations, leading to varying chunk content and hashes. This is a design flaw in Next.js's webpack integration where the CSS module import array is not sorted before generating the client reference code.
1. Clone the reproduction repo or create a minimal Next.js app with App Router and CSS modules. 2. Run `next build` with `output: 'export'`. 3. Save the output and run `next build` again. 4. Compare file hashes in `out/_next/static/chunks/app/`; observe differing `layout-*.js` files.

Fixing Code Block

Edge Case Audit

This patch modifies Next.js internals and may not be compatible with future versions. Test extensively, especially with CSS Modules, global CSS, and CSS-in-JS. Rollback by reverting the patch or removing the custom plugin. For Next.js upgrades, reapply patch if still needed.

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