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

Next.Js 16.2+ Turbopack Dev Server Blocks Worker-Entrypoint.Js Under COEP Require-Corp

Turbopack development server in Next.js 16.2+ serves the new worker-entrypoint.js without the required Cross-Origin-Resource-Policy header, causing browsers that enforce COEP require-corp to block the worker and break dev functionality.

highConfidence 75%Next.jsRoute HandlersServer ActionsAffected V16.2.0 - 16.2.1-Canary.33

Origin Analysis

Commit d23af532 introduced a new worker entrypoint that is fetched via a cross-origin-style request, but the response lacks a 'Cross-Origin-Resource-Policy: cross-origin' (or CORS) header. Under a document-level COEP require-corp policy, the browser blocks the response, preventing worker execution.
1. Set COEP header to require-corp in next.config.js. 2. Run `next dev`. 3. Open browser console and observe the worker fails to load with a COEP/CORS error.

Fixing Code Block

Edge Case Audit

This is a workaround that relaxes CORP for the worker entrypoint only. If not needed, avoid setting 'Access-Control-Allow-Origin: *' and instead use the exact origin. Test thoroughly; remove or adjust once Next.js patches the underlying Turbopack asset serving. Overly broad headers may expose the worker script to other origins.

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