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

Turbopack Asset Rule For CSS Query Url Fails In Server Components

When configuring Turbopack rules to treat `.css?url` imports as asset type, importing from a Server Component fails with 'css client asset is not css chunk placeable'. The same configuration works from Client Components and for other asset types like SVG.

highConfidence 95%Next.jsnext buildRoute HandlersReact Server ComponentsAffected V16.3.8Affected V16.4.0-Canary.57

Origin Analysis

In the RSC context, every `.css` file is intercepted by `NextCssClientReferenceTransition` before user-defined Turbopack rules are evaluated. This transition matches solely on the file path suffix `.css` and expects the module to be `CssChunkPlaceable`. When a user rule changes the module type to `asset`, the module is no longer `CssChunkPlaceable`, causing the build to fail.
1. Create `next.config.ts` with `turbopack.rules` mapping `*.css` with query `url` to type `asset`. 2. In a Server Component (e.g., `app/layout.tsx`), import `stylesUrl from './styles.css?url'` and use it in a `<link>` tag. 3. Run `next dev` or `next build`. 4. Observe the error `Module not found: Can't resolve './styles.css' ... css client asset is not css chunk placeable`.

Fixing Code Block

Edge Case Audit

This workaround disables content hashing and cache busting for the stylesheet; manual cache invalidation (e.g., adding a version query parameter) is required when the file changes. It also assumes the CSS is static and does not require processing (e.g., autoprefixing, minification). For production, the proper fix is to upgrade to a Next.js version that skips the CSS transition when a user rule sets a non-CSS type, or conditionally matches on the import query. Rollback is straightforward: remove the public file and revert the import to `./styles.css?url`.

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