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

Non-ASCII Slugs In GenerateStaticParams With Output: Export Cause Dev And Build Errors

Next.js URL-encodes dynamic route params but generateStaticParams returns raw Unicode slugs, leading to missing param errors in dev and MODULE_NOT_FOUND in build when using output: export.

highConfidence 85%Next.jsRoute HandlersPages RouterAffected V16.2.1-Canary.16

Origin Analysis

In Next.js App Router with output: export, the dynamic route parameter extracted from the URL is percent-encoded, while generateStaticParams returns the raw non-ASCII string. The dev server compares the encoded param against the raw list, causing a mismatch ('missing param'). During build, the encoded param is used to construct the module path, leading to a failed import.
1. Create a Next.js app with output: export and a dynamic route like /[slug]/page.js. 2. In generateStaticParams, return an array containing a non-ASCII slug (e.g., 'cli-환경에서-여러-명령어를-동시에-실행하기'). 3. Run next dev and navigate to that path; observe missing param error. 4. Run next build; observe Cannot find module error with encoded path.

Fixing Code Block

Edge Case Audit

This workaround is version-sensitive: if Next.js later changes to decode the param before comparison, the double encoding will cause mismatches again. Slugs containing '%' or other special characters may require careful handling. Apply decoding consistently wherever the slug is used (e.g., in dynamic imports, data fetching). Rollback: remove both encode and decode once an official fix is released. Test on all target platforms and with both dev and build.

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