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

CSS Url() Imports Resolve Incorrectly When Using MatchResource (`!=!`) With Mini-Css-Extract-Plugin

The bundled mini-css-extract-plugin v2.4.4 in Next.js does not respect matchResource (`!=!`) in importModule, causing relative asset paths in CSS url() to resolve against the wrong directory. This breaks asset references for any webpack loader using matchResource to emit CSS. Fixed upstream in mini-css-extract-plugin v2.10.2.

highConfidence 95%Next.jsHydrationServer Actions

Origin Analysis

mini-css-extract-plugin's importModule ignores the matchResource string from `!=!` requests, resolving url() paths against the original file context instead of the matchResource context. This is an upstream bug fixed in mini-css-extract-plugin v2.10.2 (webpack-contrib/mini-css-extract-plugin#1162).
1. Create a webpack loader that uses matchResource (`!=!`) syntax to emit CSS through mini-css-extract-plugin. 2. Include a CSS url() reference to a relative asset (e.g., url(./image.png)). 3. Build with `next build --webpack`. 4. Observe that the url() path resolves against the wrong directory, resulting in broken asset references.

Fixing Code Block

Edge Case Audit

Upgrading mini-css-extract-plugin may require a compatible webpack version. Verify that Next.js's webpack version supports the new plugin version. Test CSS extraction, HMR, and asset resolution thoroughly. If any new regressions appear, roll back to the previous bundled version. Also ensure no loaders depend on the old incorrect behavior.

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